mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
default dbhost is localhost + logs
This commit is contained in:
parent
82ee3f9b0d
commit
f1ee45bd8b
1 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import std/[parsecfg, os, strutils]
|
||||
import std/[parsecfg, os, strutils, logging]
|
||||
import ./defConf
|
||||
|
||||
type
|
||||
|
@ -36,9 +36,12 @@ proc getConfig(): Cfg =
|
|||
const conf = "config.ini"
|
||||
|
||||
if not conf.fileExists():
|
||||
warn "No configuration file exists."
|
||||
writeFile(conf, defaultConf)
|
||||
warn "Created default configuration file."
|
||||
|
||||
var config = loadConfig(conf)
|
||||
info "Loading configuration file."
|
||||
|
||||
return Cfg(
|
||||
# server
|
||||
|
@ -49,7 +52,7 @@ proc getConfig(): Cfg =
|
|||
appName: config.get("Server", "appName", ""),
|
||||
# database
|
||||
dbType: config.get("Database", "dbType", "postgresql"),
|
||||
dbHost: config.get("Database", "dbHost", "db"),
|
||||
dbHost: config.get("Database", "dbHost", "0.0.0.0"),
|
||||
dbUser: config.get("Database", "dbUser", "postgres"),
|
||||
dbPassword: config.get("Database", "dbPassword", "postgresql"),
|
||||
dbDatabase: config.get("Database", "dbDatabase", ""),
|
||||
|
|
Loading…
Add table
Reference in a new issue