-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
44 lines (41 loc) · 1.58 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
32
33
34
35
36
37
38
39
40
41
42
43
44
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* main.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: eej-jama <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/01/06 00:20:40 by hlakhal- #+# #+# */
/* Updated: 2024/02/15 13:47:09 by eej-jama ### ########.fr */
/* */
/* ************************************************************************** */
#include"parsingFile.hpp"
int main(int ac, char *av[])
{
try
{
webServer s;
if (ac == 2)
{
std::string input(av[1]);
loadingData(input);
}
else if (ac == 1){
std::string conf_file = "./configfile.yaml";
std::ifstream cfile;
cfile.open(conf_file.c_str());
if(cfile.is_open()){
cfile.close();
loadingData(conf_file);
}
else{
cfile.close();
throw std::runtime_error("Error in opening confique file");
}
}
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}