diff --git a/cmd/api-server/main.go b/cmd/api-server/main.go index f859cac..7242c7e 100644 --- a/cmd/api-server/main.go +++ b/cmd/api-server/main.go @@ -10,6 +10,7 @@ import ( "syscall" "time" + "github.com/joho/godotenv" "github.com/robindittmar/dttmr-api/internal/api/router" "github.com/robindittmar/dttmr-api/internal/telemetry" ) @@ -25,6 +26,8 @@ func main() { } func run(serviceName string, serviceVersion string) error { + _ = godotenv.Load(".env") + baseHandler := slog.NewJSONHandler(os.Stdout, &slog.HandlerOptions{ Level: slog.LevelInfo, }) diff --git a/go.mod b/go.mod index d15c163..ac214a6 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/robindittmar/dttmr-api go 1.26 require ( + github.com/joho/godotenv v1.5.1 go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.69.0 go.opentelemetry.io/otel v1.44.0 go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc v1.44.0