Agent utilizes configuration file (nim.cfg) and compile-time variables for listener information.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Compiler flags
|
||||
--threads:on
|
||||
-d:httpxServerName="nginx"
|
||||
#--outdir:"../bin"
|
||||
--outdir:"../bin"
|
||||
@@ -125,7 +125,8 @@ proc main() =
|
||||
setControlCHook(exit)
|
||||
|
||||
# Initialize framework
|
||||
cq = initConquest()
|
||||
let dbPath: string = "../server/db/conquest.db"
|
||||
cq = initConquest(dbPath)
|
||||
|
||||
# Print header
|
||||
cq.header()
|
||||
|
||||
@@ -135,11 +135,11 @@ proc delListener*(cq: Conquest, listenerName: string) =
|
||||
proc delAgent*(cq: Conquest, agentName: string) =
|
||||
cq.agents.del(agentName)
|
||||
|
||||
proc initConquest*(): Conquest =
|
||||
proc initConquest*(dbPath: string): Conquest =
|
||||
var cq = new Conquest
|
||||
var prompt = Prompt.init()
|
||||
cq.prompt = prompt
|
||||
cq.dbPath = "db/conquest.db"
|
||||
cq.dbPath = dbPath
|
||||
cq.listeners = initTable[string, Listener]()
|
||||
cq.agents = initTable[string, Agent]()
|
||||
cq.interactAgent = nil
|
||||
|
||||
Reference in New Issue
Block a user