diff --git a/api/src/main/nim/personal_measure_api.nim b/api/src/main/nim/personal_measure_api.nim index df6e113..3f03c8d 100644 --- a/api/src/main/nim/personal_measure_api.nim +++ b/api/src/main/nim/personal_measure_api.nim @@ -34,19 +34,15 @@ proc loadConfig*(args: Table[string, docopt.Value] = initTable[string, docopt.Va warn "Cannot read configuration file \"" & filePath & "\":\n\t" & getCurrentExceptionMsg() - let knownOriginsArray = - if json.hasKey("knownOrigins"): json["knownOrigins"] - else: newJArray() - let cfg = CombinedConfig(docopt: args, json: json) result = PMApiConfig( authSecret: cfg.getVal("auth-secret"), dbConnString: cfg.getVal("db-conn-string"), debug: "true".startsWith(cfg.getVal("debug", "false").toLower()), - port: parseInt(cfg.getVal("port", "8080")), + port: parseInt(cfg.getVal("port", "8100")), pwdCost: cast[int8](parseInt(cfg.getVal("pwd-cost", "11"))), - knownOrigins: toSeq(knownOriginsArray).mapIt(it.getStr)) + knownOrigins: cfg.getVal("known-origins")[1..^2].split(',').mapIt(it[1..^2])) proc initContext(args: Table[string, docopt.Value]): PMApiContext =