29 lines
663 B
C++
29 lines
663 B
C++
|
#include <Wt/WServer.h>
|
||
|
|
||
|
#include "MyApplication.h"
|
||
|
|
||
|
using namespace std;
|
||
|
using namespace Wt;
|
||
|
|
||
|
|
||
|
int main(int argc, char *argv[]) {
|
||
|
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;
|
||
|
}
|