owl-blogs/cmd/owl/main.go

27 lines
464 B
Go
Raw Normal View History

2023-06-25 18:04:06 +00:00
package main
import (
2023-06-25 19:32:36 +00:00
"owl-blogs/app"
2023-07-06 17:42:54 +00:00
"owl-blogs/domain/model"
2023-06-25 19:32:36 +00:00
"owl-blogs/infra"
"owl-blogs/web"
2023-06-25 18:04:06 +00:00
)
2023-07-07 19:04:25 +00:00
const DbPath = "owlblogs.db"
func App(db infra.Database) *web.WebApp {
2023-06-25 19:54:04 +00:00
registry := app.NewEntryTypeRegistry()
2023-07-06 17:42:54 +00:00
registry.Register(&model.ImageEntry{})
2023-06-25 19:54:04 +00:00
repo := infra.NewEntryRepository(db, registry)
2023-06-25 19:32:36 +00:00
entryService := app.NewEntryService(repo)
2023-07-06 20:16:52 +00:00
return web.NewWebApp(entryService, registry)
}
func main() {
2023-07-07 19:04:25 +00:00
db := infra.NewSqliteDB(DbPath)
App(db).Run()
2023-06-25 18:04:06 +00:00
}