Run scripts

This commit is contained in:
Wancat
2022-10-19 09:12:33 +08:00
parent 268b488fea
commit 25503867f9
3 changed files with 29 additions and 0 deletions

View File

@@ -74,6 +74,14 @@ func main() {
}
})
http.HandleFunc("/exec", func(w http.ResponseWriter, r *http.Request) {
if err := executeScript(w, "register"); err != nil {
http.Error(w, err.Error(), 500)
log.Println(err)
return
}
})
log.Println("Listen on http://localhost:8000")
log.Fatal(http.ListenAndServe(":8000", nil))
}