Public Lib

This commit is contained in:
Simon Martens
2025-03-23 21:19:12 +01:00
parent 52382a00e2
commit 66fedf4baf
7 changed files with 427 additions and 43 deletions

13
lenz.go
View File

@@ -10,7 +10,6 @@ import (
"github.com/Theodor-Springmann-Stiftung/lenz-web/server"
"github.com/Theodor-Springmann-Stiftung/lenz-web/templating"
"github.com/Theodor-Springmann-Stiftung/lenz-web/views"
xmlparsing "github.com/Theodor-Springmann-Stiftung/lenz-web/xml"
"github.com/Theodor-Springmann-Stiftung/lenz-web/xmlmodels"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/storage/memory/v2"
@@ -37,16 +36,16 @@ func main() {
dir := filepath.Join(cfg.BaseDIR, cfg.GITPath)
gp, err := gitprovider.OpenOrClone(dir, cfg.GitURL, cfg.GitBranch)
commit, err := gitprovider.OpenOrClone(dir, cfg.GitURL, cfg.GitBranch)
if err != nil {
panic(err)
}
// INFO: the lib, engine and storage objects passed to the server are not made to
// be recreated.
lib := xmlmodels.NewLibrary()
lib.Parse(xmlparsing.Commit, dir, gp.Hash)
// INFO: the lib, engine and storage objects passed to the server are not made to be recreated.
err = xmlmodels.New(dir, commit.Hash)
if err != nil {
panic(err)
}
engine := templating.New(&views.LayoutFS, &views.RoutesFS)
storage := memory.New(memory.Config{