diff --git a/go.mod b/go.mod index 19d317b..e00123f 100644 --- a/go.mod +++ b/go.mod @@ -6,4 +6,4 @@ require github.com/google/uuid v1.3.0 require github.com/go-chi/chi/v5 v5.0.7 -require github.com/pelletier/go-toml v1.9.4 // indirect +require github.com/pelletier/go-toml v1.9.4 diff --git a/http.go b/http.go index 8d5de92..c9f1ee1 100644 --- a/http.go +++ b/http.go @@ -10,14 +10,16 @@ import ( ) type HTTPServer struct { - store FileStore + store FileStore + config *ServerConfig http.Server } -func NewHTTPServer(store FileStore) *HTTPServer { +func NewHTTPServer(cfg *ServerConfig) *HTTPServer { srv := &HTTPServer{ - store: store, + config: cfg, } + srv.store = NewMemoryFileStore() r := chi.NewRouter() r.Get("/", srv.HandlerIndex)