diff options
| author | Alexander Kavon <hawk@alexkavon.com> | 2023-11-28 00:45:37 -0500 |
|---|---|---|
| committer | Alexander Kavon <hawk@alexkavon.com> | 2023-11-28 00:45:37 -0500 |
| commit | 7d7059d53891bc1abb284d9b288505a5d406b307 (patch) | |
| tree | f3ae7435a0a67ce1e5c939966738fea01bb9644e /src/main.go | |
| parent | d7d2b376405d91a201b8b830160458c5dd6df4a9 (diff) | |
build ui and render templates, build routes
Diffstat (limited to 'src/main.go')
| -rw-r--r-- | src/main.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/main.go b/src/main.go index fe6a51a..d3f6c03 100644 --- a/src/main.go +++ b/src/main.go @@ -5,6 +5,7 @@ import ( "gitlab.com/alexkavon/newsstand/src/conf" "gitlab.com/alexkavon/newsstand/src/db" "gitlab.com/alexkavon/newsstand/src/server" + "gitlab.com/alexkavon/newsstand/src/user" ) func main() { @@ -12,10 +13,14 @@ func main() { config := conf.NewConf() // connect database // start server - s := server.NewServer(config, server.NewRouter(config), db.NewDb(config)) - for _, route := range auth.Routes { - s.Router. - Method(route.Method, route.Pattern, route.HandlerFunc(s)) + s := server.NewServer(config, db.NewDb(config)) + s.BuildUi() + routers := []server.Routes{ + auth.Routes, + user.Routes, + } + for _, r := range routers { + s.RegisterRoutes(r) } s.Serve() } |
