diff --git a/src/forum.nim b/src/forum.nim index 7fad1a9..416436e 100644 --- a/src/forum.nim +++ b/src/forum.nim @@ -750,6 +750,9 @@ include "main.tmpl" initialise() +settings: + port = config.port.Port + routes: get "/threads.json": diff --git a/src/utils.nim b/src/utils.nim index c5f053f..834d30a 100644 --- a/src/utils.nim +++ b/src/utils.nim @@ -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)