aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-18 02:04:29 +0900
committernsfisis <nsfisis@gmail.com>2024-08-18 02:04:29 +0900
commite2a7c44805a3dea3790c7f4e2f9787dd9ff66102 (patch)
tree9037fcea86d5613a645a5b11b765c76287bc563c /backend/main.go
parented796dddde6db433c88b04a1ad154bf88a24faa4 (diff)
downloadiosdc-japan-2024-albatross-e2a7c44805a3dea3790c7f4e2f9787dd9ff66102.tar.gz
iosdc-japan-2024-albatross-e2a7c44805a3dea3790c7f4e2f9787dd9ff66102.tar.zst
iosdc-japan-2024-albatross-e2a7c44805a3dea3790c7f4e2f9787dd9ff66102.zip
feat(backend): forward all unknown requests to app server in local env
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/backend/main.go b/backend/main.go
index 890e666..1b69bb0 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -88,15 +88,6 @@ func main() {
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("/iosdc-japan/2024/code-battle/login", func(c echo.Context) error {
- return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/iosdc-japan/2024/code-battle/login")
- })
- e.POST("/iosdc-japan/2024/code-battle/logout", func(c echo.Context) error {
- return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173/iosdc-japan/2024/code-battle/logout")
- })
-
- // For local dev: This is never used in production because the reverse
// proxy directly handles /files.
filesGroup := e.Group("/iosdc-japan/2024/code-battle/files")
filesGroup.Use(middleware.StaticWithConfig(middleware.StaticConfig{
@@ -105,6 +96,15 @@ func main() {
IgnoreBase: true,
}))
+ // For local dev: This is never used in production because the reverse
+ // proxy sends these paths to the app server.
+ e.GET("/iosdc-japan/2024/code-battle/*", func(c echo.Context) error {
+ return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173"+c.Request().URL.Path)
+ })
+ e.POST("/iosdc-japan/2024/code-battle/*", func(c echo.Context) error {
+ return c.Redirect(http.StatusPermanentRedirect, "http://localhost:5173"+c.Request().URL.Path)
+ })
+
go gameHubs.Run()
go func() {