package server import ( "database/sql" "net/http" "github.com/go-chi/chi/v5" "gitlab.com/alexkavon/newsstand/src/conf" ) type Server struct { Router *chi.Mux Db *sql.DB Config *conf.Conf Ui Ui } func NewServer(config *conf.Conf, router *chi.Mux, db *sql.DB) *Server { return &Server{ Router: router, Db: db, Config: config, Ui: buildPages("my/path", "my/other/path"), } } func (s *Server) Serve() { http.ListenAndServe(":"+s.Config.Server.Port, s.Router) }