From 264fa15fb2ba5f0b9636cda44b64deb3c56aa99d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 4 Aug 2024 14:50:30 +0900 Subject: feat(backend): serve /admin/* pages from api-server --- backend/main.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'backend/main.go') 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 { -- cgit v1.2.3-70-g09d2