Improve compatibility with old browsers (#136)
All checks were successful
Backend Deploy / build (push) Successful in 3m16s
Backend Build and Test / build (push) Successful in 3m22s

Reviewed-on: #136
This commit was merged in pull request #136.
This commit is contained in:
2025-05-29 13:54:52 +02:00
parent 02c5c6ea68
commit 5a20e76df2
5 changed files with 36 additions and 10 deletions

View File

@@ -43,6 +43,11 @@ type ServerConfig struct {
Started chan bool
}
const DefaultDomain = "localhost:8080"
// The domain that the server is reachable at.
var domain = DefaultDomain
func getUsers(c *gin.Context) {
users, err := db.GetUsers()
if err != nil {
@@ -706,5 +711,10 @@ func main() {
config.Datasource = "allowance_planner.db3"
log.Printf("Warning: No DB_PATH set, using default of %s", config.Datasource)
}
domain = os.Getenv("DOMAIN")
if domain == "" {
domain = DefaultDomain
log.Printf("Warning: No DOMAIN set, using default of %s", domain)
}
start(context.Background(), &config)
}