Get the port from the json config
All checks were successful
Build and Push Docker Image / build (push) Successful in 5m53s
All checks were successful
Build and Push Docker Image / build (push) Successful in 5m53s
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
DB_URL string `json:"db_url"`
|
DB_URL string `json:"db_url"`
|
||||||
|
LISTEN_ON string `json:"listen_on"`
|
||||||
TRUSTED_PROXIES []string `json:"trusted_proxies"`
|
TRUSTED_PROXIES []string `json:"trusted_proxies"`
|
||||||
OTLP_ENDPOINT string `json:"otlp_endpoint"`
|
OTLP_ENDPOINT string `json:"otlp_endpoint"`
|
||||||
}
|
}
|
||||||
|
|||||||
4
main.go
4
main.go
@@ -74,12 +74,12 @@ func main() {
|
|||||||
// Use h2c so we can serve HTTP/2 without TLS.
|
// Use h2c so we can serve HTTP/2 without TLS.
|
||||||
p.SetUnencryptedHTTP2(true)
|
p.SetUnencryptedHTTP2(true)
|
||||||
s := http.Server{
|
s := http.Server{
|
||||||
Addr: ":3001",
|
Addr: conf.LISTEN_ON,
|
||||||
Handler: instrumentedHandler,
|
Handler: instrumentedHandler,
|
||||||
Protocols: p,
|
Protocols: p,
|
||||||
}
|
}
|
||||||
|
|
||||||
slog.Info("Starting server on :3001")
|
slog.Info("Starting server on " + conf.LISTEN_ON)
|
||||||
if err := s.ListenAndServe(); err != nil {
|
if err := s.ListenAndServe(); err != nil {
|
||||||
slog.Error("Server failed", slog.String("err", err.Error()))
|
slog.Error("Server failed", slog.String("err", err.Error()))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user