chore: reorder api package structure
This commit is contained in:
+4
-12
@@ -3,23 +3,15 @@ package api
|
||||
import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
|
||||
"orbits-server/internal/api/middleware"
|
||||
"orbits-server/internal/api/routes"
|
||||
"orbits-server/internal/utility"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const (
|
||||
okMes string = "OK"
|
||||
ieMes string = "An internal error occured, contact your administrator"
|
||||
)
|
||||
|
||||
type RespObj struct {
|
||||
Msg string `json:"msg"`
|
||||
Data any `json:"data"`
|
||||
}
|
||||
|
||||
// All error messages from slog must have an error field with the golang error
|
||||
// See bottom the the kickoff function for details
|
||||
|
||||
@@ -34,10 +26,10 @@ func KickoffApi(logger *slog.Logger, env utility.Environment, db *gorm.DB) {
|
||||
r.Use(gin.Recovery())
|
||||
|
||||
api := r.Group("/api")
|
||||
spawnApiRoutes(api /*env,*/, db)
|
||||
routes.RegisterApiRoutes(api /*env,*/, db)
|
||||
|
||||
file := r.Group("/file")
|
||||
spawnFileRoutes(file, env, db)
|
||||
routes.RegisterFileRoutes(file, env, db)
|
||||
|
||||
r.Static("/assets", "./web/frontend/dist/assets")
|
||||
r.NoRoute(func(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user