27 lines
811 B
C++
27 lines
811 B
C++
#include "Application.hpp"
|
|
#include "DatabaseConnection.hpp"
|
|
|
|
#include <eedb/auth/Services.hpp>
|
|
#include <eedb/db/connection.hpp>
|
|
|
|
#include <Wt/WApplication>
|
|
#include <Wt/WServer>
|
|
|
|
Wt::WApplication * createApplication(const Wt::WEnvironment & env) {
|
|
auto dbConnection = eedb::DbConnection{}.create(env);
|
|
return eedb::Application{}.create(env, std::move(dbConnection));
|
|
}
|
|
|
|
int main(int argc, char ** argv) {
|
|
try {
|
|
Wt::WServer server(argc, argv, WTHTTP_CONFIGURATION);
|
|
server.addEntryPoint(Wt::Application, createApplication);
|
|
eedb::auth::Services::configureAuth();
|
|
server.run();
|
|
} catch(Wt::WServer::Exception & e) {
|
|
std::cerr << e.what() << std::endl;
|
|
} catch(std::exception & e) {
|
|
std::cerr << "exception: " << e.what() << std::endl;
|
|
}
|
|
}
|