diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:14:17 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-10 00:14:17 +0900 |
| commit | b450648caa0d1bd5c91e67a33153bbacaf57f006 (patch) | |
| tree | 8dce01b8eb398759a3abdb97d3d333b52738c768 /backend/main.go | |
| parent | a7342525e5e4052113e6d5e75b6fd50c91687514 (diff) | |
| download | iosdc-japan-2024-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.tar.gz iosdc-japan-2024-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.tar.zst iosdc-japan-2024-albatross-b450648caa0d1bd5c91e67a33153bbacaf57f006.zip | |
feat: prepend base path
Diffstat (limited to 'backend/main.go')
| -rw-r--r-- | backend/main.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/backend/main.go b/backend/main.go index 575c3f8..c01394b 100644 --- a/backend/main.go +++ b/backend/main.go @@ -38,7 +38,7 @@ func main() { log.Fatalf("Error loading env %v", err) } - openAPISpec, err := api.GetSwaggerWithPrefix("/api") + openAPISpec, err := api.GetSwaggerWithPrefix("/iosdc-japan/2024/code-battle/api") if err != nil { log.Fatalf("Error loading OpenAPI spec\n: %s", err) } @@ -69,7 +69,7 @@ func main() { log.Fatalf("Error restoring game hubs from db %v", err) } defer gameHubs.Close() - sockGroup := e.Group("/sock") + sockGroup := e.Group("/iosdc-japan/2024/code-battle/sock") sockHandler := gameHubs.SockHandler() sockGroup.GET("/golf/:gameID/play", func(c echo.Context) error { return sockHandler.HandleSockGolfPlay(c) @@ -78,22 +78,22 @@ func main() { return sockHandler.HandleSockGolfWatch(c) }) - apiGroup := e.Group("/api") + apiGroup := e.Group("/iosdc-japan/2024/code-battle/api") apiGroup.Use(oapimiddleware.OapiRequestValidator(openAPISpec)) apiHandler := api.NewHandler(queries, gameHubs) api.RegisterHandlers(apiGroup, api.NewStrictHandler(apiHandler, nil)) adminHandler := admin.NewHandler(queries, gameHubs) - adminGroup := e.Group("/admin") + adminGroup := e.Group("/iosdc-japan/2024/code-battle/admin") adminHandler.RegisterHandlers(adminGroup) // For local dev: This is never used in production because the reverse // proxy sends /login and /logout to the app server. e.GET("/login", func(c echo.Context) error { - return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/login") + return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/iosdc-japan/2024/code-battle/login") }) e.POST("/logout", func(c echo.Context) error { - return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/logout") + return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/iosdc-japan/2024/code-battle/logout") }) go gameHubs.Run() |
