Implements ability to specify the HTTP port.
This commit is contained in:
parent
b9df0ec895
commit
b8c1ae1fe0
2 changed files with 5 additions and 0 deletions
|
|
@ -750,6 +750,9 @@ include "main.tmpl"
|
||||||
|
|
||||||
initialise()
|
initialise()
|
||||||
|
|
||||||
|
settings:
|
||||||
|
port = config.port.Port
|
||||||
|
|
||||||
routes:
|
routes:
|
||||||
|
|
||||||
get "/threads.json":
|
get "/threads.json":
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ type
|
||||||
hostname*: string
|
hostname*: string
|
||||||
name*, title*: string
|
name*, title*: string
|
||||||
ga*: string
|
ga*: string
|
||||||
|
port*: int
|
||||||
|
|
||||||
ForumError* = object of Exception
|
ForumError* = object of Exception
|
||||||
data*: PostError
|
data*: PostError
|
||||||
|
|
@ -66,6 +67,7 @@ proc loadConfig*(filename = getCurrentDir() / "forum.json"): Config =
|
||||||
result.name = root["name"].getStr()
|
result.name = root["name"].getStr()
|
||||||
result.title = root["title"].getStr()
|
result.title = root["title"].getStr()
|
||||||
result.ga = root{"ga"}.getStr()
|
result.ga = root{"ga"}.getStr()
|
||||||
|
result.port = root{"port"}.getNum(5000).int
|
||||||
|
|
||||||
proc processGT(n: XmlNode, tag: string): (int, XmlNode, string) =
|
proc processGT(n: XmlNode, tag: string): (int, XmlNode, string) =
|
||||||
result = (0, newElement(tag), tag)
|
result = (0, newElement(tag), tag)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue