Changed the directory structure, added a build script
[theodwalha.git] / theodwalha / source / main.cpp
blob3e4c401dcded950c3727eb919e4b988169c6eeed
1 #include <iostream>
2 #include <boost/asio.hpp>
3 #include <ail/types.hpp>
4 #include <theodwalha/server.hpp>
5 #include <theodwalha/configuration.hpp>
7 bool run_server()
9 boost::asio::io_service io_service;
10 http_server server(io_service, temporary_file_directory);
11 if(!server.launch_server(http_server_port))
12 return false;
13 std::cout << "Running IO service" << std::endl;
14 io_service.run();
15 return true;
18 int main(int argc, char ** argv)
20 if(argc != 2)
22 std::cout << "Usage:" << std::endl;
23 std::cout << argv[0] << " <configuration file>" << std::endl;
24 return 1;
27 std::string configuration_file_path = argv[1];
28 if(!parse_configuration_file(configuration_file_path))
29 return 1;
31 if(!run_server())
32 return 1;
34 return 0;