Wt examples: hello/hello.C File Reference

Wt examples 4.10.4

Loading...
Searching...
No Matches
Classes | Functions
hello.C File Reference
`#include <Wt/WApplication.h>`
`#include <Wt/WBreak.h>`
`#include <Wt/WContainerWidget.h>`
`#include <Wt/WLineEdit.h>`
`#include <Wt/WPushButton.h>`
`#include <Wt/WText.h>`

Go to the source code of this file.

## Classes
class | HelloApplication

## Functions
int | main (int argc, char **argv)

## Function Documentation

## ◆ main()

int main | ( | int | argc,
|  | char ** | argv )

Definition at line 82 of file hello.C.

83{
84 /*
85 * Your main method may set up some shared resources, but should then
86 * start the server application (FastCGI or httpd) that starts listening
87 * for requests, and handles all of the application life cycles.
88 *
89 * The last argument to WRun specifies the function that will instantiate
90 * new application objects. That function is executed when a new user surfs
91 * to the Wt application, and after the library has negotiated browser
92 * support. The function should return a newly instantiated application
93 * object.
94 */
95 return Wt::WRun(argc, argv, [](const Wt::WEnvironment &env) {
96 /*
97 * You could read information from the environment to decide whether
98 * the user has permission to start a new application
99 */
100 return std::make_unique<HelloApplication>(env);
101 });
102}