-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
35 lines (29 loc) · 835 Bytes
/
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
32
33
34
35
#include <iostream>
#include <fstream>
#include <map>
#include <vector>
#include <string>
#include "./ServerConfig/ServerConfig.hpp"
#include "./ServerEngine/ServerEngine.hpp"
/* this webserver is maded by 100% recycled code, so echo friendly !!! */
int main(int argc, char** argv)
{
ServerEngine server_engine;
ServerConfig server_config;
std::vector<struct server_config_struct> config_set;
/* config file parsing */
if (argc == 1 || argc == 2)
{
if (argc == 2)
{
std::string path(argv[1]);
server_config.set_path(path);
}
server_config.make_config();
config_set = server_config.get_config();
}
server_engine.set_config_set(config_set);
server_engine.make_serversocket();
server_engine.start_kqueue();
return (0);
}