server
Some checks failed
Build / build (push) Failing after 6m4s
Test / build (push) Failing after 6m33s

This commit is contained in:
Chuck Smith
2024-04-02 12:21:41 -04:00
parent 862119e90e
commit 4c9ec5aaaa
77 changed files with 1181 additions and 244 deletions

View File

@@ -0,0 +1,29 @@
package server
import (
"monkey"
"net/http"
"go.mills.io/router"
)
func (s *Server) runHandler() router.Handle {
return func(w http.ResponseWriter, r *http.Request, p router.Params) {
opts := &monkey.Options{
Stdout: w,
Stderr: w,
}
err := monkey.ExecString(r.FormValue("code"), opts)
if err != nil {
http.Error(w, err.Error(), 400)
return
}
}
}
func (s *Server) formatHandler() router.Handle {
return func(w http.ResponseWriter, r *http.Request, p router.Params) {
http.Error(w, "Not Implemented", http.StatusNotImplemented)
}
}