mirror of
https://github.com/Theodor-Springmann-Stiftung/kgpz_web.git
synced 2025-10-29 00:55:32 +00:00
Better structure of files; introduced XML models
This commit is contained in:
@@ -13,13 +13,14 @@ import (
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cache"
|
||||
"github.com/gofiber/fiber/v2/middleware/etag"
|
||||
"github.com/gofiber/fiber/v2/middleware/logger"
|
||||
"github.com/gofiber/fiber/v2/middleware/recover"
|
||||
"github.com/gofiber/storage/memory/v2"
|
||||
)
|
||||
|
||||
const (
|
||||
// INFO: This timeout is stupid. Uploads can take a long time, others might not. It's messy.
|
||||
// INFO: This timeout is stupid. Uploads can take a long time, other routes might not. It's messy.
|
||||
REQUEST_TIMEOUT = 16 * time.Second
|
||||
SERVER_TIMEOUT = 16 * time.Second
|
||||
|
||||
@@ -91,6 +92,7 @@ func (s *Server) Engine(e *templating.Engine) {
|
||||
s.Start()
|
||||
}
|
||||
|
||||
// TODO: There is no error handler
|
||||
func (s *Server) Start() {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
@@ -133,6 +135,7 @@ func (s *Server) Start() {
|
||||
|
||||
srv.Use(recover.New())
|
||||
|
||||
srv.Use(ASSETS_URL_PREFIX, etag.New())
|
||||
srv.Use(ASSETS_URL_PREFIX, static(&views.StaticFS))
|
||||
|
||||
// TODO: Dont cache static assets, bc storage gets huge
|
||||
|
||||
Reference in New Issue
Block a user