diff options
| author | Alexander Kavon <hawk@alexkavon.com> | 2023-11-13 23:20:13 -0500 |
|---|---|---|
| committer | Alexander Kavon <hawk@alexkavon.com> | 2023-11-13 23:20:13 -0500 |
| commit | 6cfc9a99c046f2bc52d3a976aff03fdcd4b94180 (patch) | |
| tree | 0607f8f8b6ecadbf43864d1d29cd622e6e25653e /main.go | |
router and config loader
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +package main + +import ( + "net/http" + "gitlab.com/alexkavon/newsstand/conf" + "github.com/go-chi/chi/v5" + "github.com/go-chi/chi/v5/middleware" +) + +func main() { + // load config + conf.Load() + r := chi.NewRouter() + r.Use(middleware.Logger) + r.Get("/", func(w http.ResponseWriter, r *http.Request) { + w.Write([]byte("Yello There!")) + }) + http.ListenAndServe(":8080", r) +} |
