Files
wallet/backend/server/configure.go
T
wt 303b9344f8
Build and Test / build-and-test-backend (push) Successful in 28s
Build and Test / build-and-test-frontend (push) Successful in 33s
added InitMiddlewares and delete jwtFromBody
2025-08-10 14:37:07 +07:00

34 lines
750 B
Go

package server
import (
"backend/api"
"backend/database"
"backend/utils"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/log"
)
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)
}