20 lines
369 B
Go
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)
|
|
}
|
|
}
|