-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
32 lines (29 loc) · 1.29 KB
/
main.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gborne <gborne@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/27 16:30:46 by gborne #+# #+# */
/* Updated: 2023/05/23 19:29:56 by gborne ### ########.fr */
/* */
/* ************************************************************************** */
#include "inc/Server.hpp"
#include "inc/Config.hpp"
int main( int argc, char **argv ) {
if (argc != 2)
std::cout << "command: ./webserv <config.conf>" << std::endl;
else {
try {
HTTP::Config config(argv[1]);
//std::cout << config << std::endl;
HTTP::Server server(&config);
server.run();
} catch(const std::exception& e) {
std::cerr << ERROR << e.what() << std::endl;
return 1;
}
}
return 0;
}