package main import ( "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "hupeh.vip/pricing/app" "log" "net/http" ) func main() { app.ConfigLogger("debug.log", app.LogWhenMinute) app.ConfigGormDB() r := chi.NewRouter() r.Use(middleware.Logger) r.Get("/goods", app.Handler(app.GetGoodsList)) r.Post("/goods", app.Handler(app.CreateGoods)) r.Get("/goods/:id/prices", app.Handler(app.GetGoodsPrices)) r.Post("/goods/:id", app.Handler(app.UpdateGoods)) if err := http.ListenAndServe(":3000", r); err != nil { log.Fatalln(err) } }