Added port to configuration

This commit is contained in:
Tristan B. Kildaire 2020-07-22 13:00:01 +02:00
parent f1756e250a
commit 4692bcaa36
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,5 @@
{
"domain" : "10.0.0.9:2222",
"address" : "0.0.0.0"
"address" : "0.0.0.0",
"port" : "6969"
}

View File

@ -4,6 +4,7 @@ import server.server : ButterflyServer;
import std.socket : Address, parseAddress;
import std.file;
import std.json;
import std.conv;
void main()
{
@ -21,6 +22,6 @@ void main()
config = parseJSON(cast(string)bytes);
/* Start the server */
Address address = parseAddress(config["address"].str(), 6969);
Address address = parseAddress(config["address"].str(), to!(ushort)(config["port"].str()));
ButterflyServer server = new ButterflyServer(address, config["domain"].str());
}