added routes package and serve in server package
Build and Test / build-and-test-backend (push) Successful in 27s
Build and Test / build-and-test-frontend (push) Successful in 32s

This commit is contained in:
wt committed 2025-08-10 15:09:09 +07:00
1 parent 303b9344f8
commit 547949795f
8 files changed
+74 -77

No files matched your search

+4 -12
View File
@@ -3,6 +3,7 @@ package server
import (
"backend/api"
"backend/database"
"backend/routes"
"backend/utils"
"github.com/gofiber/fiber/v2"
@@ -13,21 +14,12 @@ func Configure(app *fiber.App) {
utils.LoadEnv("wallet.conf")
database.InitDatabase()
log.SetLevel(log.LevelDebug)
app.Static("/", "../frontend/build")
apiGroup := app.Group("/api")
apiGroup.Post("/token", api.Login)
InitMiddlewares(app)
usersGroup := apiGroup.Group("/users")
usersGroup.Get("/", api.GetAllUsers)
usersGroup.Get("/user", api.GetUserData)
operationGroup := apiGroup.Group("/operation")
operationGroup.Get("/", api.GetAllOperation)
categoryGroup := apiGroup.Group("/category")
categoryGroup.Get("/", api.GetAllCategories)
categoryGroup.Post("/", api.CreateCategory)
routes.UsersRoutes(apiGroup)
routes.OperationRoutes(apiGroup)
routes.CategoryRoutes(apiGroup)
}