Add static page routing, place API under /api/
This commit is contained in:
parent
e89af34c5c
commit
d635420a9f
3 changed files with 29 additions and 9 deletions
|
@ -34,7 +34,12 @@ func main() {
|
|||
}
|
||||
|
||||
log.Println("Registering handlers...")
|
||||
http.HandleFunc("/", ApiRouting)
|
||||
mux := http.NewServeMux()
|
||||
mux.Handle("/api/", http.StripPrefix("/api", ApiHandler()))
|
||||
mux.HandleFunc("/teams", StaticRouting)
|
||||
mux.HandleFunc("/themes", StaticRouting)
|
||||
mux.Handle("/", http.FileServer(http.Dir("./static/")))
|
||||
http.HandleFunc("/", mux.ServeHTTP)
|
||||
|
||||
log.Println(fmt.Sprintf("Ready, listening on %s", *bind))
|
||||
if err := http.ListenAndServe(*bind, nil); err != nil {
|
||||
|
|
Reference in a new issue