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.

29 lines
670 B

#include "webserv.hpp"
2 years ago
fd_set Master::_readfds;
int Master::_max_fd;
int Master::_min_fd = INT_MAX;
int Master::_amount = 0;
2 years ago
int main(int ac, char **av) {
2 years ago
if (ac != 2) {
cout << "Usage:\n./webserv CONF.json\n";
return EXIT_SUCCESS;
}
2 years ago
std::ifstream file(av[1]);
if (!file.good()) {
cout << "Error: " << av[1] << " is not a valid file\n";
return EXIT_FAILURE;
}
2 years ago
cout << "Parsing configuration file from JSON conf file.\n";
cout << "You must be sure the syntax is correct\n";
JSONParser parser(av[1]);
JSONNode *conf = parser.parse();
cout << "Initialization of server...\n";
Env env(conf);
while (1)
env.cycle();
return EXIT_SUCCESS;
2 years ago
}