Wt examples
3.7.1
public-git
wt
examples
wt-homepage
main.C
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2009 Emweb bv, Herent, Belgium.
3
*
4
* See the LICENSE file for terms of use.
5
*/
6
7
#include <Wt/WServer>
8
#include <Wt/Dbo/SqlConnectionPool>
9
10
#include "BlogRSSFeed.h"
11
#include "model/BlogSession.h"
12
#include "model/Token.h"
13
#include "model/User.h"
14
#include "
WtHome.h
"
15
#include "
JWtHome.h
"
16
17
int
main
(
int
argc,
char
**argv)
18
{
19
try
{
20
WServer
server(argc, argv, WTHTTP_CONFIGURATION);
21
22
BlogSession::configureAuth();
23
24
Wt::Dbo::SqlConnectionPool
*blogDb
25
= BlogSession::createConnectionPool(server.
appRoot
() +
"blog.db"
);
26
27
BlogRSSFeed rssFeed(*blogDb,
"Wt and JWt blog"
,
28
"http://www.webtoolkit.eu/wt/blog"
,
29
"We care about our webtoolkits."
);
30
31
server.
addResource
(&rssFeed,
"/wt/blog/feed/"
);
32
33
server.
addEntryPoint
(
Application
,
34
boost::bind(&
createJWtHomeApplication
, _1, blogDb),
35
"/jwt"
,
"/css/jwt/favicon.ico"
);
36
server.
addEntryPoint
(
Application
,
37
boost::bind(&
createWtHomeApplication
, _1, blogDb),
38
""
,
"/css/wt/favicon.ico"
);
39
40
server.
run
();
41
42
delete
blogDb;
43
}
catch
(
Wt::WServer::Exception
& e) {
44
std::cerr << e.
what
() << std::endl;
45
}
catch
(std::exception &e) {
46
std::cerr <<
"exception: "
<< e.what() << std::endl;
47
}
48
}
main
int main(int argc, char **argv)
Definition:
main.C:17
WtHome.h
Wt::WException::what
virtual const char * what() const override
Wt::Dbo::SqlConnectionPool
Wt::WServer::run
WTCONNECTOR_API void run()
Wt::WServer
Wt::WServer::addResource
WT_API void addResource(WResource *resource, const std::string &path)
Wt::EntryPointType::Application
Wt::WServer::appRoot
WT_API std::string appRoot() const
createJWtHomeApplication
WApplication * createJWtHomeApplication(const WEnvironment &env, Wt::Dbo::SqlConnectionPool *blogDb)
Definition:
JWtHome.C:157
createWtHomeApplication
WApplication * createWtHomeApplication(const WEnvironment &env, Wt::Dbo::SqlConnectionPool *blogDb)
Definition:
WtHome.C:170
Wt::WServer::addEntryPoint
WT_API void addEntryPoint(EntryPointType type, ApplicationCreator callback, const std::string &path=std::string(), const std::string &favicon=std::string())
Wt::WServer::Exception
JWtHome.h
Generated on Tue Dec 15 2020 for
the C++ Web Toolkit (Wt)
by
1.8.13