mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
16 lines
392 B
Nim
16 lines
392 B
Nim
import std/httpcore
|
|
|
|
template H*(s: string): untyped =
|
|
$request.headers[s]
|
|
|
|
template reqInfo*: string =
|
|
$request.reqMethod & " " & request.host & request.path & " " & request.ip &
|
|
" " & $request.headers["user-agent"]
|
|
|
|
template respErr*(s: string): untyped =
|
|
error s & reqInfo
|
|
resp Http403, s
|
|
|
|
template respErr*(e: HttpCode, s: string): untyped =
|
|
error s & reqInfo
|
|
resp e, s
|