Add debug switch and API endpoint to stop server when in debug mode.

This commit is contained in:
Jonathan Bernard
2017-04-23 00:18:57 -05:00
parent 06b8914e7b
commit 3e8bbb1676
5 changed files with 14 additions and 2 deletions

View File

@ -34,6 +34,7 @@ type
StrawBossConfig* = object
artifactsRepo*: string
authSecret*: string
debug*: bool
projects*: seq[ProjectDef]
pwdCost*: int8
users*: seq[UserRef]
@ -98,6 +99,7 @@ proc loadStrawBossConfig*(cfgFile: string): StrawBossConfig =
result = StrawBossConfig(
artifactsRepo: jsonCfg.getIfExists("artifactsRepo").getStr("artifacts"),
authSecret: jsonCfg.getOrFail("authSecret", "strawboss config").getStr,
debug: jsonCfg.getIfExists("debug").getBVal(false),
pwdCost: int8(jsonCfg.getOrFail("pwdCost", "strawboss config").getNum),
projects: projectDefs,
users: users)