WIP new http server

This commit is contained in:
2020-06-02 00:23:07 +02:00
parent 89ccd5ff02
commit d504f8cd5d
10 changed files with 120 additions and 34 deletions

View File

@@ -1,8 +1,5 @@
import json
const
defaultPort* = 5555 ## Default port at which the control server will run
type
OpResult* = object of RootObj ## Result object for signalling failure state across proc calls
success*: bool ## Indicating if the opration was successfull
@@ -30,7 +27,7 @@ proc newOpResult*(): OpResult =
proc newOpResult*(msg: string): OpResult =
OpResult(success: false, errorMsg: msg)
proc newCommand*(c: Command, p: string = ""): CommandMessage =
proc newCommandMessage*(c: Command, p: string = ""): CommandMessage =
CommandMessage(command: c, parameter: p)
proc wrap*(msg: CommandMessage): string =