mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
35 lines
566 B
C++
35 lines
566 B
C++
#include "webserv.hpp"
|
|
#include "parse.hpp"
|
|
#include "Server.hpp"
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
(void)argc;
|
|
(void)argv;
|
|
|
|
Server server;
|
|
char *path = (char *)"config/def.toml";
|
|
|
|
try
|
|
{
|
|
if (argv[1] != NULL)
|
|
server.readConfig(argv[1]);
|
|
else
|
|
server.readConfig(path);
|
|
server.run();
|
|
}
|
|
catch(const ConfigException& e)
|
|
{
|
|
std::cerr << RED << "\n" << WARNING << getDebugTime()
|
|
<< FAIL << " " << e.getMessage() << ENDL;
|
|
}
|
|
catch (std::domain_error &e)
|
|
{
|
|
std::cerr << RED << "FATAL: ";
|
|
std::cerr << e.what() << RESET << std::endl;
|
|
}
|
|
|
|
|
|
}
|