respErr with custom http code

This commit is contained in:
array-in-a-matrix 2024-08-12 15:11:31 -04:00
parent 32fca05210
commit a0be08d559

View file

@ -1,3 +1,5 @@
import std/httpcore
template H*(s: string): untyped =
$request.headers[s]
@ -8,3 +10,7 @@ template reqInfo*: string =
template respErr*(s: string): untyped =
error s & reqInfo
resp Http403, s
template respErr*(e: HttpCode, s: string): untyped =
error s & reqInfo
resp e, s