File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,13 +4,14 @@ import (
44 "context"
55 "errors"
66 "fmt"
7- "github.com/serverledge-faas/serverledge/internal/metrics"
87 "log"
98 "net/http"
109 "os"
1110 "os/signal"
1211 "time"
1312
13+ "github.com/serverledge-faas/serverledge/internal/metrics"
14+
1415 "github.com/labstack/echo/v4"
1516 "github.com/labstack/echo/v4/middleware"
1617 "github.com/serverledge-faas/serverledge/internal/cache"
@@ -31,6 +32,7 @@ func StartAPIServer(e *echo.Echo) {
3132 e .GET ("/function" , GetFunctions )
3233 e .GET ("/poll/:reqId" , PollAsyncResult )
3334 e .GET ("/status" , GetServerStatus )
35+ e .POST ("/prewarm" , PrewarmFunction )
3436
3537 if config .GetBool (config .METRICS_ENABLED , false ) {
3638 e .GET ("/metrics" , func (c echo.Context ) error {
Original file line number Diff line number Diff line change @@ -392,6 +392,11 @@ func ReadSourcesAsTar(srcPath string) ([]byte, error) {
392392}
393393
394394func deleteFunction (cmd * cobra.Command , args []string ) {
395+ if len (funcName ) < 1 {
396+ fmt .Println ("Missing function name for deletion." )
397+ showHelpAndExit (cmd )
398+ }
399+
395400 request := function.Function {Name : funcName }
396401 requestBody , err := json .Marshal (request )
397402 if err != nil {
You can’t perform that action at this time.
0 commit comments