2024-09-12 22:12:19 +03:00
|
|
|
#include <Wt/WServer.h>
|
|
|
|
|
|
|
|
#include "MyApplication.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace Wt;
|
|
|
|
|
|
|
|
|
2024-09-12 22:40:20 +03:00
|
|
|
int main(int argc, char* argv[]) {
|
2024-09-12 22:12:19 +03:00
|
|
|
int code = 0;
|
|
|
|
|
|
|
|
try {
|
|
|
|
WServer server(argc, argv, WTHTTP_CONFIGURATION);
|
|
|
|
|
|
|
|
using namespace placeholders;
|
|
|
|
|
|
|
|
server.addEntryPoint( EntryPointType::Application,
|
|
|
|
[](const WEnvironment& env){return make_unique<MyApplication>(env);},
|
|
|
|
"/"
|
|
|
|
);
|
|
|
|
|
|
|
|
server.run();
|
|
|
|
}
|
|
|
|
catch ( WServer::Exception& e ) { cerr << e.what() << endl; code = -1; }
|
|
|
|
catch ( std::exception& e ) { cerr << "exception: " << e.what() << endl; code = -1; }
|
|
|
|
|
|
|
|
return code;
|
|
|
|
}
|