-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
28 lines (27 loc) · 986 Bytes
/
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
28
/*
* Copyright (C) 2008 Emweb bvba, Heverlee, Belgium.
*
* See the LICENSE file for terms of use.
*/
#include "HelloApplication.hpp"
int main(int argc, char **argv)
{
/*
* Your main method may set up some shared resources, but should then
* start the server application (FastCGI or httpd) that starts listening
* for requests, and handles all of the application life cycles.
*
* The last argument to WRun specifies the function that will instantiate
* new application objects. That function is executed when a new user surfs
* to the Wt application, and after the library has negotiated browser
* support. The function should return a newly instantiated application
* object.
*/
return Wt::WRun(argc, argv, [](const Wt::WEnvironment &env) {
/*
* You could read information from the environment to decide whether
* the user has permission to start a new application
*/
return std::make_unique<HelloApplication>(env);
});
}