You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
908 B
Go
45 lines
908 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
"git.phc.dm.unipi.it/phc/website/model"
|
|
"git.phc.dm.unipi.it/phc/website/services/config"
|
|
"git.phc.dm.unipi.it/phc/website/services/database"
|
|
"git.phc.dm.unipi.it/phc/website/services/server"
|
|
"git.phc.dm.unipi.it/phc/website/sl"
|
|
)
|
|
|
|
func main() {
|
|
l := sl.New()
|
|
|
|
cfg := sl.InjectValue(l, config.Slot, &config.Config{
|
|
Mode: "production",
|
|
Host: ":4000",
|
|
})
|
|
|
|
sl.InjectValue[database.Database](l, database.Slot, &database.Memory{
|
|
Users: []model.User{
|
|
{
|
|
Id: "claire",
|
|
FullName: "Claire Doe",
|
|
Nickname: "claire-doe",
|
|
AuthSources: map[string]model.AuthSource{},
|
|
},
|
|
{
|
|
Id: "john",
|
|
FullName: "John Smith",
|
|
Nickname: "john-smith",
|
|
AuthSources: map[string]model.AuthSource{},
|
|
},
|
|
},
|
|
})
|
|
|
|
srv, err := server.Configure(l)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
|
|
log.Fatal(srv.Router.Listen(cfg.Host))
|
|
}
|