Gocirc/http.go
2026-07-12 20:19:15 +03:00

20 lines
369 B
Go

package main
import (
"fmt"
"net/http"
)
func startHTTP(cfg Config) {
htport := cfg.Webapiport
http.HandleFunc("/admin/", handleAdmin)
fmt.Printf("[web] starting API on port %d\n", htport)
http.ListenAndServe(fmt.Sprintf(":%d", htport), nil)
}
func handleAdmin(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
default:
http.NotFound(w, r)
}
}