mirror of
https://github.com/Theodor-Springmann-Stiftung/lenz-web.git
synced 2025-10-28 16:55:32 +00:00
BUGFIX: race condition in engine; index page controller
This commit is contained in:
11
controllers/index.go
Normal file
11
controllers/index.go
Normal file
@@ -0,0 +1,11 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/xmlmodels"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func GetIndex(fiber *fiber.Ctx) error {
|
||||
_ = xmlmodels.Get()
|
||||
return fiber.Render("/", nil)
|
||||
}
|
||||
@@ -4,10 +4,16 @@ import (
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/helpers/middleware"
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/server"
|
||||
"github.com/Theodor-Springmann-Stiftung/lenz-web/views"
|
||||
|
||||
"github.com/gofiber/fiber/v2/middleware/compress"
|
||||
)
|
||||
|
||||
const ASSETS_URL = "/assets"
|
||||
|
||||
func Register(server server.Server) {
|
||||
server.Server.Use(ASSETS_URL, compress.New(compress.Config{
|
||||
Level: compress.LevelBestSpeed,
|
||||
}))
|
||||
server.Server.Use(ASSETS_URL, middleware.StaticHandler(&views.StaticFS))
|
||||
server.Server.Get("/", GetIndex)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user