nitter/src/routes/router_utils.nim
Zed de62eedea5 Refactor hostname to be a runtime option
Add a `hostname` field under Server in your conf file, see the
updated nitter.conf in the repo for an example. The compile-time
option (-d:hostname) is no longer used.
2019-10-21 05:19:00 +02:00

12 lines
351 B
Nim

import ../utils, ../prefs
export utils, prefs
template cookiePrefs*(): untyped {.dirty.} =
getPrefs(request.cookies.getOrDefault("preferences"), cfg.hostname)
template getPath*(): untyped {.dirty.} =
$(parseUri(request.path) ? filterParams(request.params))
template refPath*(): untyped {.dirty.} =
if @"referer".len > 0: @"referer" else: "/"