mirror of
https://github.com/zedeus/nitter
synced 2026-09-05 22:59:31 +00:00
Refactor routing code
This commit is contained in:
parent
7bdf5b0f76
commit
014f01bf88
7 changed files with 253 additions and 203 deletions
11
src/routes/router_utils.nim
Normal file
11
src/routes/router_utils.nim
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import ../utils
|
||||
|
||||
template cookiePrefs*(): untyped {.dirty.} =
|
||||
getPrefs(request.cookies.getOrDefault("preferences"))
|
||||
|
||||
template getPath*(): untyped {.dirty.} =
|
||||
$(parseUri(request.path) ? filterParams(request.params))
|
||||
|
||||
template refPath*(): untyped {.dirty.} =
|
||||
if @"referer".len > 0: @"referer" else: "/"
|
||||
|
||||
Loading…
Reference in a new issue