-
Notifications
You must be signed in to change notification settings - Fork 0
/
webserv.cpp
39 lines (36 loc) · 1.39 KB
/
webserv.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* webserv.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: rimney <rimney@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/25 20:56:08 by eel-ghan #+# #+# */
/* Updated: 2023/04/02 03:29:11 by rimney ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/parsing.hpp"
#include "includes/servers.hpp"
int main(int argc, char **argv)
{
if(argc == 2)
{
try
{
config_parser config(argv[1]);
servers s;
if (s.setup(config.getServersObject()))
{
return 1;
}
s.run();
}
catch(const std::string& msg)
{
std::cerr << msg << '\n';
}
}
else
std::cerr << "ERROR: bad args number\n";
return 0;
}