feat: add static file serving and refactor route registration
This commit is contained in:
20
backend/app/http/super/static.go
Normal file
20
backend/app/http/super/static.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package super
|
||||
|
||||
import (
|
||||
"github.com/gofiber/fiber/v3"
|
||||
)
|
||||
|
||||
// @provider
|
||||
type staticController struct{}
|
||||
|
||||
// Static
|
||||
//
|
||||
// @Tags Super
|
||||
// @Router /super/*
|
||||
func (ctl *staticController) static(ctx fiber.Ctx) error {
|
||||
param := ctx.Params("*")
|
||||
if param == "" {
|
||||
param = "index.html"
|
||||
}
|
||||
return ctx.SendFile("/home/rogee/Projects/quyun_v2/frontend/superadmin/dist/" + param)
|
||||
}
|
||||
Reference in New Issue
Block a user