copy layout from kontor-api
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s

This commit is contained in:
2026-09-20 22:17:42 +02:00
parent ad09386a7a
commit 652aa3005b
8 changed files with 237 additions and 17 deletions
+17 -2
View File
@@ -5,10 +5,12 @@ import (
"kontor-api-fiber/pkg/schema"
"kontor-api-fiber/pkg/web"
"log"
"time"
jwtware "github.com/gofiber/contrib/v3/jwt"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3/middleware/logger"
"github.com/gofiber/fiber/v3/middleware/static"
"github.com/gofiber/template/html/v3"
)
@@ -22,7 +24,8 @@ func main() {
engine := html.New("./views", ".html")
app := fiber.New(fiber.Config{
Views: engine,
Views: engine,
ViewsLayout: "layouts/main",
})
//app.Use(logger.New())
@@ -38,8 +41,20 @@ func main() {
api.Use(logger.New())
handler.SetupComicRoutes(api)
handler.SetupMediaRoutes(api)
app.Get("/*", static.New("./static", static.Config{
Browse: false,
MaxAge: 3600,
CacheDuration: 10 * time.Second,
NotFoundHandler: func(c fiber.Ctx) error {
return c.Status(fiber.StatusNotFound).JSON(fiber.Map{
"error": "asset not found",
"path": c.Path(),
})
},
}))
// Listen on port 8900
app.Listen(":8500")
app.Listen(":8510")
log.Println("Kontor finished")
}