Project

General

Profile

Bug #4462 » main.cpp

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

 
#include <iostream>
#include <Wt/WApplication>
#include <Wt/WEnvironment>
#include <Wt/WContainerWidget>
#include <Wt/WText>
using namespace std;
using namespace Wt;


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

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

private:

};

WApplication* create_app(const WEnvironment& env)
{
return new c_web_app(env);
}

int main(int argc, char *argv[])
{
const int a = 9;
char *v[a];

v[0] = argv[0];

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

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

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


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



return WRun(a, v, &create_app);
}

(2-2/2)