This commit is contained in:
xiaojibeier
2026-07-18 23:13:11 +08:00
parent b49c30a081
commit 87bfc7b54e
17 changed files with 1871 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
package main
import (
"fmt"
"log"
"net/http"
)
func main() {
mux := http.NewServeMux()
mux.HandleFunc("/api/health", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json; charset=utf-8")
_, _ = w.Write([]byte(`{"ok":true,"service":"weihai_pm"}`))
})
addr := ":8080"
fmt.Printf("weihai_pm server listening on %s\n", addr)
log.Fatal(http.ListenAndServe(addr, mux))
}
+3
View File
@@ -0,0 +1,3 @@
module weihai.pm/server
go 1.22