Updates to compile on Nim 0.19

This commit is contained in:
Jonathan Bernard 2019-01-17 13:18:25 -06:00
parent f8ccc831ef
commit d4db66a71e
2 changed files with 5 additions and 5 deletions

View File

@ -11,5 +11,5 @@ bin = @["pit", "pit_api"]
# Dependencies
requires @[ "nim >= 0.19.0", "cliutils 0.6.0", "docopt 0.6.8", "jester 0.4.1",
requires @[ "nim >= 0.19.0", "cliutils 0.6.1", "docopt 0.6.8", "jester 0.4.1",
"langutils >= 0.4.0", "timeutils 0.3.0", "uuids 0.1.10" ]

View File

@ -56,7 +56,7 @@ template checkAuth(cfg: PitApiCfg) =
stderr.writeLine "Auth failed: " & getCurrentExceptionMsg()
halt(
Http401,
headers & @{"Content-Type": TXT},
@{"Content-Type": TXT},
getCurrentExceptionMsg())
proc start*(cfg: PitApiCfg) =
@ -73,7 +73,7 @@ proc start*(cfg: PitApiCfg) =
resp("pong", TXT)
get "/issues":
checkAuth(cfg); if not authed: return true
checkAuth(cfg)
var args = queryParamsToCliArgs(request.params)
args = @["list"] & args
@ -84,10 +84,10 @@ proc start*(cfg: PitApiCfg) =
else: resp(stripAnsi(execResult[0]), TXT)
post "/issues":
checkAuth(cfg); if not authed: return true
checkAuth(cfg)
get "/issue/@issueId":
checkAuth(cfg); if not authed: return true
checkAuth(cfg)
var args = queryParamsToCliArgs(request.params)
args = @["list", @"issueId"] & args