aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-04 14:50:30 +0900
committernsfisis <nsfisis@gmail.com>2024-08-04 16:59:10 +0900
commit264fa15fb2ba5f0b9636cda44b64deb3c56aa99d (patch)
tree61de974c9ed1aa5b94b6d5900fdb8e3a2d4b3efd /backend/main.go
parent1b794787a5194405cd99d80981008e20aa0e953d (diff)
downloadphperkaigi-2025-albatross-264fa15fb2ba5f0b9636cda44b64deb3c56aa99d.tar.gz
phperkaigi-2025-albatross-264fa15fb2ba5f0b9636cda44b64deb3c56aa99d.tar.zst
phperkaigi-2025-albatross-264fa15fb2ba5f0b9636cda44b64deb3c56aa99d.zip
feat(backend): serve /admin/* pages from api-server
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/main.go b/backend/main.go
index 939df03..7330109 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -11,6 +11,7 @@ import (
"github.com/labstack/echo/v4/middleware"
oapimiddleware "github.com/oapi-codegen/echo-middleware"
+ "github.com/nsfisis/iosdc-japan-2024-albatross/backend/admin"
"github.com/nsfisis/iosdc-japan-2024-albatross/backend/api"
"github.com/nsfisis/iosdc-japan-2024-albatross/backend/db"
"github.com/nsfisis/iosdc-japan-2024-albatross/backend/game"
@@ -53,6 +54,7 @@ func main() {
queries := db.New(connPool)
e := echo.New()
+ e.Renderer = admin.NewRenderer()
e.Use(middleware.Logger())
e.Use(middleware.Recover())
@@ -77,6 +79,10 @@ func main() {
apiHandler := api.NewHandler(queries, gameHubs)
api.RegisterHandlers(apiGroup, api.NewStrictHandler(apiHandler, nil))
+ adminHandler := admin.NewAdminHandler(queries, gameHubs)
+ adminGroup := e.Group("/admin")
+ adminHandler.RegisterHandlers(adminGroup)
+
gameHubs.Run()
if err := e.Start(":80"); err != http.ErrServerClosed {