add proxy (WIP).

This commit is contained in:
Miroslav Šedivý
2022-07-31 17:24:00 +02:00
parent b5c0a0b801
commit 679142a471
4 changed files with 282 additions and 2 deletions
+3 -1
View File
@@ -24,7 +24,7 @@ type ServerManagerCtx struct {
config *config.Server
}
func New(ApiManager types.ApiManager, pathPrefix string, config *config.Server) *ServerManagerCtx {
func New(ApiManager types.ApiManager, pathPrefix string, config *config.Server, handler http.Handler) *ServerManagerCtx {
logger := log.With().Str("module", "server").Logger()
router := chi.NewRouter()
@@ -73,6 +73,8 @@ func New(ApiManager types.ApiManager, pathPrefix string, config *config.Server)
logger.Info().Msgf("with pprof endpoint at %s", pprofPath)
}
router.Handle("/*", handler)
// we could use custom 404
router.NotFound(http.NotFound)