Improve compatibility with old browsers (#136)
Reviewed-on: #136
This commit was merged in pull request #136.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user