Estratto il servizio lista utenti e qualche altra modifica
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"git.phc.dm.unipi.it/phc/website/auth"
|
||||
"git.phc.dm.unipi.it/phc/website/config"
|
||||
"git.phc.dm.unipi.it/phc/website/handler"
|
||||
"git.phc.dm.unipi.it/phc/website/lista_utenti"
|
||||
"git.phc.dm.unipi.it/phc/website/server"
|
||||
"git.phc.dm.unipi.it/phc/website/storia"
|
||||
"git.phc.dm.unipi.it/phc/website/templates"
|
||||
@@ -15,8 +16,15 @@ import (
|
||||
func main() {
|
||||
config.Load()
|
||||
|
||||
authService := auth.NewDefaultService(config.AuthServiceHost)
|
||||
|
||||
listaUtentiService, err := lista_utenti.New(authService, config.ListaUtenti)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
h := &handler.DefaultHandler{
|
||||
AuthService: auth.NewDefaultService(config.AuthServiceHost),
|
||||
AuthService: authService,
|
||||
Renderer: templates.NewRenderer(
|
||||
"./_views/",
|
||||
"./_views/base.html",
|
||||
@@ -24,20 +32,16 @@ func main() {
|
||||
),
|
||||
NewsArticlesRegistry: articles.NewRegistry("./_content/news"),
|
||||
GuideArticlesRegistry: articles.NewRegistry("./_content/guide"),
|
||||
// ListaUtenti: &website.JsonFileListaUtenti{
|
||||
// Path: "./utenti-poisson-2022.local.json",
|
||||
// },
|
||||
ListaUtentiService: auth.NewLDAPAuthService(config.AuthServiceHost),
|
||||
Storia: &storia.JsonFileStoria{
|
||||
Path: "./storia.json",
|
||||
},
|
||||
ListaUtenti: listaUtentiService,
|
||||
}
|
||||
|
||||
app := server.NewFiberServer(h)
|
||||
|
||||
log.Printf("Starting server on host %q", config.Host)
|
||||
err := app.Listen(config.Host)
|
||||
if err != nil {
|
||||
if err := app.Listen(config.Host); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user