⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Wt
All Projects
Wt
Overview
Activity
Roadmap
Issues
Wiki
Forums
Download (995 Bytes)
Rendering template within a template on the server-side.
» main.cpp
Plug Gulp
, 03/04/2019 12:27 AM
#include
<cstdlib>
#include
<signal.h>
#include
<Wt/WServer.h>
#include
"start.hpp"
extern
char
**
environ
;
// POSIX defined
int
main
(
int
argc
,
char
**
argv
)
{
auto
r
=
EXIT_FAILURE
;
try
{
// Initialise a web server.
Wt
::
WServer
server
{
argc
,
argv
};
// Load the web app user interface.
auto
bundle
=
std
::
make_shared
<
Wt
::
WMessageResourceBundle
>
();
bundle
->
use
(
server
.
appRoot
()
+
"web_ui"
);
server
.
setLocalizedStrings
(
bundle
);
// Mount the web app request handler.
start
_start
;
server
.
addResource
(
&
_start
,
"/"
);
// Start the server and handle shutdown.
if
(
server
.
start
())
{
int
sig
=
Wt
::
WServer
::
waitForShutdown
();
server
.
stop
();
if
(
SIGHUP
==
sig
)
{
Wt
::
WServer
::
restart
(
argc
,
argv
,
environ
);
}
else
{
r
=
EXIT_SUCCESS
;
}
}
}
catch
(
Wt
::
WException
const
&
e
)
{
std
::
cerr
<<
"Wt Exception: "
<<
e
.
what
()
<<
std
::
endl
;
}
catch
(
std
::
exception
const
&
e
)
{
std
::
cerr
<<
"Standard Exception: "
<<
e
.
what
()
<<
std
::
endl
;
}
return
r
;
}
« Previous
1
2
3
Next »
(2-2/3)
Loading...