diff --git a/main.go b/main.go index 5fa830e..35f194c 100644 --- a/main.go +++ b/main.go @@ -37,6 +37,7 @@ func main() { } g := fastglue.New() + g.GET("/", handleIndex()) g.POST("/{script}", handleExecuteScript(ko.String("script_folder"))) s := &fasthttp.Server{ @@ -52,6 +53,14 @@ func main() { } } +func handleIndex() fastglue.FastRequestHandler { + return func(r *fastglue.Request) error { + r.RequestCtx.WriteString("Hello from http-script-executor.") + r.RequestCtx.SetStatusCode(fasthttp.StatusOK) + return nil + } +} + func handleExecuteScript(scripts string) fastglue.FastRequestHandler { return func(r *fastglue.Request) error { script := r.RequestCtx.UserValue("script").(string)