You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
621 B

2 years ago
#include "../webserv.hpp"
#include "Server.hpp"
class Env {
//int _max_clients;
std::vector<Server> _servers;
public:
Env(JSONNode *conf) {
conf->obj()["max_clients"]->nbr();
JSONList servers = conf->obj()["servers"]->lst();
int i = 0;
string th[8]= {"first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eigth"};
for (std::vector<JSONNode *>::iterator it = servers.begin();
it < servers.end(); it++) {
Server *server = new Server(*it);
delete *it;
server->launch();
cout << th[i] << " server launched.";
i++;
}
delete conf;
}
};