chore: refactor main
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
|
||||
"git.phc.dm.unipi.it/phc/website/server/config"
|
||||
"git.phc.dm.unipi.it/phc/website/server/database"
|
||||
"git.phc.dm.unipi.it/phc/website/server/listautenti"
|
||||
"git.phc.dm.unipi.it/phc/website/server/model"
|
||||
)
|
||||
|
||||
@@ -23,10 +24,7 @@ func init() {
|
||||
func main() {
|
||||
l := sl.New()
|
||||
|
||||
cfg := sl.InjectValue(l, config.Slot, config.Config{
|
||||
Mode: "development",
|
||||
Host: ":4000",
|
||||
})
|
||||
cfg := sl.InjectValue(l, config.Slot, config.TestingDevelopmentConfig)
|
||||
|
||||
sl.InjectValue[database.Database](l, database.Slot, &database.Memory{
|
||||
Users: []model.User{
|
||||
@@ -45,7 +43,10 @@ func main() {
|
||||
},
|
||||
})
|
||||
|
||||
srv, err := server.Configure(l)
|
||||
sl.InjectLazy(l, server.Slot, server.Configure)
|
||||
sl.InjectLazy(l, listautenti.Slot, listautenti.Configure)
|
||||
|
||||
srv, err := sl.Use(l, server.Slot)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
@@ -56,7 +57,7 @@ func main() {
|
||||
|
||||
r, w := io.Pipe()
|
||||
|
||||
cmd := exec.Command("npm", "run", "dev")
|
||||
cmd := exec.Command("pnpm", "run", "dev")
|
||||
cmd.Stdout = w
|
||||
|
||||
go func() {
|
||||
|
||||
Reference in New Issue
Block a user