forked from Alfombruh/webserv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
34 lines (30 loc) · 623 Bytes
/
Copy pathmain.cpp
File metadata and controls
34 lines (30 loc) · 623 Bytes
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
#include "webserv.h"
#include <csignal>
#include "srcs/config/configParser.hpp"
#include "srcs/classes/config.hpp"
void signalHandler(int signal)
{
system("leaks webserv");
exit(signal);
}
Config configuration;
int main(int argc, char **argv)
{
if (argc != 2)
return (errorMessage("./webserv configFile.conf"));
std::signal(SIGINT, signalHandler);
try
{
ConfigParser parser(argv[1]);
configuration = parser.getConfiguration();
// configuration.printConfig();
Server server;
server.setup();
server.run();
}
catch (const std::exception &e)
{
std::cerr << e.what() << '\n';
}
return (0);
}