WIP Dockerizing API.

This commit is contained in:
Jonathan Bernard
2019-04-07 03:07:17 -05:00
parent fcf0cf18f6
commit 3e68462c28
5 changed files with 50 additions and 7 deletions

View File

@ -37,11 +37,11 @@ proc loadConfig*(args: Table[string, docopt.Value] = initTable[string, docopt.Va
let cfg = CombinedConfig(docopt: args, json: json)
result = PMApiConfig(
authSecret: cfg.getVal("authSecret"),
dbConnString: cfg.getVal("dbConnString"),
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")),
pwdCost: cast[int8](parseInt(cfg.getVal("pwdCost", "11"))))
pwdCost: cast[int8](parseInt(cfg.getVal("pwd-cost", "11"))))
proc initContext(args: Table[string, docopt.Value]): PMApiContext =
@ -68,7 +68,7 @@ Usage:
Options:
-C, --config <cfgFile> Location of the config file (defaults to personal_measure.config.json)
-C, --config <cfgFile> Location of the config file (defaults to personal_measure_api.config.json)
--salt <salt> Use a given salt for password hashing
--pwdCost <cost> Specify the cost for password hashing
"""