initial commit. Cloned timetracker repository
This commit is contained in:
26
app/delivery/web/public/bo.go
Normal file
26
app/delivery/web/public/bo.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package public
|
||||
|
||||
import (
|
||||
"git.ma-al.com/goc_marek/timetracker/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")
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user