Added static pages

This commit is contained in:
Simon Martens
2024-12-03 20:15:39 +01:00
parent 71927afebd
commit 5f6886a144
17 changed files with 72 additions and 30 deletions

View File

@@ -101,14 +101,12 @@ func (s *Server) Watcher() error {
func (s *Server) Start() {
s.engine.Reload()
if s.cache != nil {
s.cache.Close()
if s.cache == nil {
s.cache = memory.New(memory.Config{
GCInterval: 30 * time.Second,
})
}
s.cache = memory.New(memory.Config{
GCInterval: 30 * time.Second,
})
srv := fiber.New(fiber.Config{
AppName: s.Config.Address,
CaseSensitive: false,
@@ -165,6 +163,11 @@ func (s *Server) Start() {
srv.Get("/:year/:issue/:page?", controllers.GetIssue(s.kgpz))
srv.Get("/:year/:issue/beilage/:page?", controllers.GetIssue(s.kgpz))
srv.Get("/edition/", controllers.Get("/edition/"))
srv.Get("/datenschutz/", controllers.Get("/datenschutz/"))
srv.Get("/kontakt/", controllers.Get("/kontakt/"))
srv.Get("/zitation/", controllers.Get("/zitation/"))
s.runner(srv)
if s.Config.Debug {
@@ -228,7 +231,7 @@ func (s *Server) runner(srv *fiber.App) {
logging.Error(err, "Error closing server cleanly. Shutting server down by force.")
clean = false
}
s.cache.Close()
s.cache.Reset()
}
if !clean {