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.

23 lines
592 B

2 years ago
#include "../webserv.hpp"
#include "Server.hpp"
class Env {
//int _max_clients;
std::vector<Server> _servers;
public:
Env(JSONNode *conf) {
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++) {
2 years ago
Server *server = new Server(*it);
server->launch();
//delete *it;
cout << th[i] << " server launched.\n";
2 years ago
i++;
}
2 years ago
//delete conf;
2 years ago
}
};