Initial commit

This commit is contained in:
mathias
2026-05-27 21:55:18 +00:00
commit d1193a57c6
23 changed files with 730 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
package main
import (
"log/slog"
"net/http"
"os"
"gitea.d-ma.be/mathias/hostexecutor/internal/web"
)
func main() {
logger := slog.New(slog.NewJSONHandler(os.Stdout, nil))
mux := http.NewServeMux()
mux.HandleFunc("/healthz", func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte("ok"))
})
mux.Handle("/", web.NewHandler())
addr := ":8080"
logger.Info("hostexecutor starting", "addr", addr)
if err := http.ListenAndServe(addr, mux); err != nil {
logger.Error("server stopped", "err", err)
os.Exit(1)
}
}