Implements ability to specify the HTTP port.

This commit is contained in:
Dominik Picheta 2018-05-23 12:48:31 +01:00
commit b8c1ae1fe0
2 changed files with 5 additions and 0 deletions

View file

@ -750,6 +750,9 @@ include "main.tmpl"
initialise()
settings:
port = config.port.Port
routes:
get "/threads.json":

View file

@ -29,6 +29,7 @@ type
hostname*: string
name*, title*: string
ga*: string
port*: int
ForumError* = object of Exception
data*: PostError
@ -66,6 +67,7 @@ proc loadConfig*(filename = getCurrentDir() / "forum.json"): Config =
result.name = root["name"].getStr()
result.title = root["title"].getStr()
result.ga = root{"ga"}.getStr()
result.port = root{"port"}.getNum(5000).int
proc processGT(n: XmlNode, tag: string): (int, XmlNode, string) =
result = (0, newElement(tag), tag)