Project

General

Profile

Bug #4462 » main.cpp

Pau Garcia i Quiles, 09/08/2015 02:14 PM

 
1
#include <iostream>
2
#include <Wt/WApplication>
3
#include <Wt/WEnvironment>
4
#include <Wt/WContainerWidget>
5
#include <Wt/WText>
6
using namespace std;
7
using namespace Wt;
8

    
9

    
10
class c_web_app : public WApplication
11
{
12
public:
13
    c_web_app(const WEnvironment& env) : WApplication(env)
14
    {
15
        this->setTitle("Web App! Now title not work.");
16
        WContainerWidget *webpage = new WContainerWidget(this->root());
17

    
18
        webpage->addWidget(new WText("Hello!"));
19
    }
20

    
21
private:
22

    
23
};
24

    
25
WApplication* create_app(const WEnvironment& env)
26
{
27
    return new c_web_app(env);
28
}
29

    
30
int main(int argc, char *argv[])
31
{
32
    const int a = 9;
33
    char *v[a];
34

    
35
    v[0] = argv[0];
36

    
37
    v[1] = (char*) "--http-address";
38
    v[2] = (char*) "0.0.0.0";
39

    
40
    v[3] = (char*) "--http-port";
41
    v[4] = (char*) "8080";
42

    
43
    v[5] = (char*) "--deploy-path";
44
    v[6] = (char*)  "/";
45

    
46

    
47
    v[7] = (char*) "--docroot";
48
    v[8] = (char*) ".;/resources";
49

    
50

    
51

    
52
    return WRun(a, v, &create_app);
53
}
54

    
(2-2/2)