[BREAKING] added entrypoint middleware support and config, config schema update

This commit is contained in:
yusing
2024-11-30 08:02:03 +08:00
parent 3af3a88f66
commit 1c1ba1b55e
9 changed files with 274 additions and 74 deletions

View File

@@ -137,23 +137,21 @@ func main() {
HTTPAddr: common.ProxyHTTPAddr,
HTTPSAddr: common.ProxyHTTPSAddr,
Handler: http.HandlerFunc(entrypoint.Handler),
RedirectToHTTPS: config.Value().RedirectToHTTPS,
RedirectToHTTPS: config.Value().Entrypoint.RedirectToHTTPS,
})
server.StartServer(server.Options{
Name: "api",
CertProvider: autocert,
HTTPAddr: common.APIHTTPAddr,
Handler: api.NewHandler(),
RedirectToHTTPS: config.Value().RedirectToHTTPS,
Name: "api",
CertProvider: autocert,
HTTPAddr: common.APIHTTPAddr,
Handler: api.NewHandler(),
})
if common.PrometheusEnabled {
server.StartServer(server.Options{
Name: "metrics",
CertProvider: autocert,
HTTPAddr: common.MetricsHTTPAddr,
Handler: metrics.NewHandler(),
RedirectToHTTPS: config.Value().RedirectToHTTPS,
Name: "metrics",
CertProvider: autocert,
HTTPAddr: common.MetricsHTTPAddr,
Handler: metrics.NewHandler(),
})
}