first
This commit is contained in:
@@ -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))
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
module weihai.pm/server
|
||||
|
||||
go 1.22
|
||||
Reference in New Issue
Block a user