Add create post endpoint and check target to the makefile

This commit is contained in:
Miguel de la Cruz 2021-09-25 17:23:56 +02:00
parent 08ab312f92
commit 3067beb96c
12 changed files with 280 additions and 5 deletions

View file

@ -42,6 +42,7 @@ func (w *WebServer) RegisterRoutes(api *api.API) {
apiRouter.HandleFunc("/games", api.Secured(api.CreateGame)).Methods("POST")
apiRouter.HandleFunc("/games", api.Secured(api.ListGames)).Methods("GET")
apiRouter.HandleFunc("/games/{id:[0-9]+}", api.Secured(api.GetGame)).Methods("GET")
apiRouter.HandleFunc("/games/{id:[0-9]+}/post", api.Secured(api.CreatePostForGame)).Methods("POST")
staticFSSub, _ := fs.Sub(staticFS, "static")
staticFSHandler := StaticFSHandler{http.FileServer(http.FS(staticFSSub))}