summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'cmd')
-rw-r--r--cmd/sparkled/main.go15
1 files changed, 2 insertions, 13 deletions
diff --git a/cmd/sparkled/main.go b/cmd/sparkled/main.go
index cf99f4f..13ba03b 100644
--- a/cmd/sparkled/main.go
+++ b/cmd/sparkled/main.go
@@ -5,26 +5,15 @@ import (
"net/http"
"github.com/xlgmokha/x/pkg/env"
- "github.com/xlgmokha/x/pkg/ioc"
- "gitlab.com/mokhax/sparkled/pkg/db"
- "gitlab.com/mokhax/sparkled/pkg/web"
+ "gitlab.com/mokhax/sparkled/app"
)
-func init() {
- ioc.RegisterSingleton[db.Repository](ioc.Default, func() db.Repository {
- return db.NewRepository()
- })
- ioc.RegisterSingleton[*web.Server](ioc.Default, func() *web.Server {
- return web.New(ioc.MustResolve[db.Repository](ioc.Default))
- })
-}
-
func main() {
bindAddr := env.Fetch("BIND_ADDR", ":http")
log.Printf("Listening on %v\n", bindAddr)
log.Fatal(http.ListenAndServe(
bindAddr,
- ioc.MustResolve[*web.Server](ioc.Default),
+ app.New(),
))
}