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/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
|
||||||
|
8
http.go
8
http.go
@ -10,14 +10,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type HTTPServer struct {
|
type HTTPServer struct {
|
||||||
store FileStore
|
store FileStore
|
||||||
|
config *ServerConfig
|
||||||
http.Server
|
http.Server
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHTTPServer(store FileStore) *HTTPServer {
|
func NewHTTPServer(cfg *ServerConfig) *HTTPServer {
|
||||||
srv := &HTTPServer{
|
srv := &HTTPServer{
|
||||||
store: store,
|
config: cfg,
|
||||||
}
|
}
|
||||||
|
srv.store = NewMemoryFileStore()
|
||||||
|
|
||||||
r := chi.NewRouter()
|
r := chi.NewRouter()
|
||||||
r.Get("/", srv.HandlerIndex)
|
r.Get("/", srv.HandlerIndex)
|
||||||
|
Loading…
Reference in New Issue
Block a user