another fix

This commit is contained in:
2026-08-22 20:08:37 +02:00
parent 84b50fc87f
commit 9f1424447f
2 changed files with 8 additions and 1 deletions
+6 -1
View File
@@ -80,6 +80,7 @@ func main() {
downloadHandler := downloads.NewHandler(galleryRepository, mediaRepository, objectStorage, authService, downloadService)
devHandler := devtools.NewHandler(database, objectStorage, authService, devtools.Config{
DBDriver: cfg.DBDriver,
APIURL: cfg.APIURL,
StorageEndpoint: cfg.StorageEndpoint,
StorageBucket: cfg.StorageBucket,
StorageUseSSL: cfg.StorageUseSSL,
@@ -113,7 +114,11 @@ func main() {
}
go func() {
log.Printf("API listening on http://localhost%s", server.Addr)
addr := cfg.APIURL
if addr == "" {
addr = "http://localhost" + server.Addr
}
log.Printf("API listening on %s", addr)
if err := server.ListenAndServe(); err != nil && err != http.ErrServerClosed {
log.Fatalf("server failed: %v", err)
}
+2
View File
@@ -17,6 +17,7 @@ import (
type Config struct {
DBDriver string
APIURL string
StorageEndpoint string
StorageBucket string
StorageUseSSL bool
@@ -67,6 +68,7 @@ func (h *Handler) Diagnostics(c *gin.Context) {
writeJSON(c, http.StatusOK, map[string]any{
"environment": "development",
"now": time.Now().UTC().Format(time.RFC3339),
"url": h.config.APIURL,
"user": map[string]string{
"id": user.ID.String(),
"email": user.Email,