package web import ( "database/sql" "log/slog" "github.com/martinlehoux/biking_home/config" "github.com/martinlehoux/kagamigo/kcore" ) func ServeCmd(db *sql.DB, configPath string, appConfig config.Config, enablePprof bool) { server := NewServer(db, configPath).WithPprof(enablePprof) if enablePprof { slog.Info("pprof enabled", "endpoint", appConfig.Server.PublicURL+"/debug/pprof/") } slog.Info("Starting web server", "address", appConfig.Server.PublicURL) kcore.Expect(server.ListenAndServe(appConfig.Server.Address), "web server stopped") }