-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
executable file
·27 lines (22 loc) · 1.02 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
#include <web/helpers/HandlerMatcher.hpp>
#include <web/request_handlers/RequestHandlersContainerBase.hpp>
#include <web/tcp_server/TCPServer.hpp>
#include <web/request_handlers/TestContainer.hpp>
#include <web/request_handlers/RegistrationContainers.hpp>
#include <web/request_handlers/CORSContainers.hpp>
#include <logging/Logger.hpp>
int main() {
std::vector<web_layout::RequestHandlersContainerBase> requests_containers = {
web_layout::CORSContainer(),web_layout::RegistrationContainers(),web_layout::TestContainer(),
};
web_layout::Container full_container;
for (const web_layout::RequestHandlersContainerBase& container_base : requests_containers){
full_container.AddValues(container_base.GetContainer());
}
web_layout::RouterBase router(full_container);
Logger(Debug).Print("Server restart");
web_layout::TCPServer server("127.0.0.1", 80);
std::shared_ptr<web_layout::WebServer> handler = std::make_shared<web_layout::WebServer>(router);
server.StartListen(handler);
return 0;
}