Updates to compile on Nim 0.19
This commit is contained in:
parent
f8ccc831ef
commit
d4db66a71e
@ -11,5 +11,5 @@ bin = @["pit", "pit_api"]
|
|||||||
|
|
||||||
# Dependencies
|
# 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" ]
|
"langutils >= 0.4.0", "timeutils 0.3.0", "uuids 0.1.10" ]
|
||||||
|
@ -56,7 +56,7 @@ template checkAuth(cfg: PitApiCfg) =
|
|||||||
stderr.writeLine "Auth failed: " & getCurrentExceptionMsg()
|
stderr.writeLine "Auth failed: " & getCurrentExceptionMsg()
|
||||||
halt(
|
halt(
|
||||||
Http401,
|
Http401,
|
||||||
headers & @{"Content-Type": TXT},
|
@{"Content-Type": TXT},
|
||||||
getCurrentExceptionMsg())
|
getCurrentExceptionMsg())
|
||||||
|
|
||||||
proc start*(cfg: PitApiCfg) =
|
proc start*(cfg: PitApiCfg) =
|
||||||
@ -73,7 +73,7 @@ proc start*(cfg: PitApiCfg) =
|
|||||||
resp("pong", TXT)
|
resp("pong", TXT)
|
||||||
|
|
||||||
get "/issues":
|
get "/issues":
|
||||||
checkAuth(cfg); if not authed: return true
|
checkAuth(cfg)
|
||||||
|
|
||||||
var args = queryParamsToCliArgs(request.params)
|
var args = queryParamsToCliArgs(request.params)
|
||||||
args = @["list"] & args
|
args = @["list"] & args
|
||||||
@ -84,10 +84,10 @@ proc start*(cfg: PitApiCfg) =
|
|||||||
else: resp(stripAnsi(execResult[0]), TXT)
|
else: resp(stripAnsi(execResult[0]), TXT)
|
||||||
|
|
||||||
post "/issues":
|
post "/issues":
|
||||||
checkAuth(cfg); if not authed: return true
|
checkAuth(cfg)
|
||||||
|
|
||||||
get "/issue/@issueId":
|
get "/issue/@issueId":
|
||||||
checkAuth(cfg); if not authed: return true
|
checkAuth(cfg)
|
||||||
|
|
||||||
var args = queryParamsToCliArgs(request.params)
|
var args = queryParamsToCliArgs(request.params)
|
||||||
args = @["list", @"issueId"] & args
|
args = @["list", @"issueId"] & args
|
||||||
|
Loading…
x
Reference in New Issue
Block a user