forked from Qirall79/webserv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
36 lines (32 loc) · 1.32 KB
/
main.cpp
File metadata and controls
36 lines (32 loc) · 1.32 KB
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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wbelfatm <wbelfatm@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/09/05 08:04:58 by wbelfatm #+# #+# */
/* Updated: 2024/11/13 12:29:53 by wbelfatm ### ########.fr */
/* */
/* ************************************************************************** */
#include "Webserv.hpp"
int main(int argc, char **argv)
{
std::string path;
signal(SIGPIPE, SIG_IGN);
if (argc > 1)
path = argv[1];
else
path = "./config/default.conf";
std::string configPath(path);
try
{
Webserv webserv;
webserv.init(configPath);
webserv.listen();
}
catch (const std::exception& e)
{
std::cerr << "Config file error: " << e.what() << '\n';
}
}