Begin removing several dependencies on Config object
This commit is contained in:
@@ -24,5 +24,16 @@ SOFTWARE.
|
||||
|
||||
std::unique_ptr<GatewayInterface> createGateway(const Config &c)
|
||||
{
|
||||
return std::make_unique<HttpGateway>(c);
|
||||
std::string listenaddr = c.configVarResolver.getConfig("http.listenaddr");
|
||||
if(listenaddr.empty())
|
||||
{
|
||||
throw new std::runtime_error("No http.listenaddr in config file");
|
||||
}
|
||||
std::string listenport = c.configVarResolver.getConfig("http.listenport");
|
||||
if(listenport.empty())
|
||||
{
|
||||
throw new std::runtime_error("No http.listenport in config file");
|
||||
}
|
||||
|
||||
return std::make_unique<HttpGateway>(listenaddr, std::stoi(listenport), c.max_payload_length);
|
||||
}
|
||||
|
Reference in New Issue
Block a user