From b8c1ae1fe0d5423e5164700496b5bee63f1b62ca Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Wed, 23 May 2018 12:48:31 +0100 Subject: [PATCH] Implements ability to specify the HTTP port. --- src/forum.nim | 3 +++ src/utils.nim | 2 ++ 2 files changed, 5 insertions(+) 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)