Change http server to use new config
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
affae5941b
commit
81886c842c
2
go.mod
2
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
|
||||
|
6
http.go
6
http.go
@ -11,13 +11,15 @@ import (
|
||||
|
||||
type HTTPServer struct {
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user