Add create game and list games endpoints
This commit is contained in:
parent
38c7229216
commit
2d2cd288f2
4 changed files with 76 additions and 1 deletions
|
@ -38,7 +38,9 @@ func (w *WebServer) RegisterRoutes(api *api.API) {
|
|||
apiRouter := r.PathPrefix("/api").Subrouter()
|
||||
|
||||
apiRouter.HandleFunc("/login", api.Login).Methods("POST")
|
||||
apiRouter.HandleFunc("/user", api.Secured(api.CreateUser)).Methods("POST")
|
||||
apiRouter.HandleFunc("/users", api.Secured(api.CreateUser)).Methods("POST")
|
||||
apiRouter.HandleFunc("/games", api.Secured(api.CreateGame)).Methods("POST")
|
||||
apiRouter.HandleFunc("/games", api.Secured(api.ListGames)).Methods("GET")
|
||||
|
||||
staticFSSub, _ := fs.Sub(staticFS, "static")
|
||||
staticFSHandler := StaticFSHandler{http.FileServer(http.FS(staticFSSub))}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue