27 lines
559 B
Go
27 lines
559 B
Go
package general
|
|
|
|
import (
|
|
"git.ma-al.com/goc_daniel/b2b/assets"
|
|
"github.com/gofiber/fiber/v3"
|
|
"github.com/gofiber/fiber/v3/middleware/static"
|
|
)
|
|
|
|
func InitBo(app *fiber.App) {
|
|
// static files
|
|
app.Get("/*", static.New("", static.Config{
|
|
FS: assets.FS(),
|
|
// Browse: true,
|
|
MaxAge: 60 * 60 * 24 * 30, // 30 days
|
|
}))
|
|
|
|
app.Get("/*", static.New("", static.Config{
|
|
FS: assets.FSDist(),
|
|
// Browse: true,
|
|
MaxAge: 60 * 60 * 24 * 30, // 30 days
|
|
}))
|
|
|
|
app.Get("/*", func(c fiber.Ctx) error {
|
|
return c.SendFile("./assets/public/dist/index.html")
|
|
})
|
|
}
|