This commit is contained in:
Tomas Dvorak
2026-02-24 10:33:08 +01:00
parent b083dac3f0
commit 55d0284b2a
90 changed files with 27855 additions and 1940 deletions
+32
View File
@@ -0,0 +1,32 @@
package handlers
import (
"fmt"
"net/http"
"os"
"github.com/gin-gonic/gin"
)
func GetAPIConfig(c *gin.Context) {
scheme := "http"
if c.Request.TLS != nil {
scheme = "https"
}
host := c.Request.Host
if host == "" {
host = os.Getenv("HOST")
if host == "" {
host = "localhost:8080"
}
}
apiURL := fmt.Sprintf("%s://%s/api/v1", scheme, host)
c.JSON(http.StatusOK, gin.H{
"api_url": apiURL,
"demo_mode": os.Getenv("VITE_DEMO_MODE") == "true",
"version": "1.0.0",
})
}