Tinkering with how to do a 'check view, then static' style of templates, but maybe I need to do a generator?

This commit is contained in:
Zed A. Shaw 2025-06-29 22:47:03 -04:00
parent abc9fbda2e
commit b9d5dbb2e9
3 changed files with 20 additions and 11 deletions

View file

@ -3,7 +3,6 @@ package main
import (
"log"
"os"
"time"
"os/signal"
"syscall"
"github.com/gofiber/fiber/v2"
@ -25,6 +24,8 @@ func main() {
app := fiber.New(fiber.Config{
Views: engine,
ViewsLayout: "layouts/main",
CaseSensitive: true,
StrictRouting: true,
})
app.Use(logger.New())
@ -33,11 +34,6 @@ func main() {
api.Setup(app)
data.Setup("sqlite3", "db.sqlite3")
app.Static("/", "./public", fiber.Static{
Compress: true,
CacheDuration: 1 * time.Nanosecond,
})
// this sets up graceful shutdown
go func() {
if err := app.Listen(":5001"); err != nil {