Wt examples  3.3.5
/usr/src/RPM/BUILD/wt-3.3.5-rc2/examples/wt-homepage/main.C
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009 Emweb bvba, Kessel-Lo, Belgium.
00003  *
00004  * See the LICENSE file for terms of use.
00005  */
00006 
00007 #include <Wt/WServer>
00008 #include <Wt/Dbo/SqlConnectionPool>
00009 
00010 #include "BlogRSSFeed.h"
00011 #include "model/BlogSession.h"
00012 #include "model/Token.h"
00013 #include "model/User.h"
00014 #include "WtHome.h"
00015 #include "JWtHome.h"
00016 
00017 int main(int argc, char **argv)
00018 {
00019   try {
00020     WServer server(argc, argv, WTHTTP_CONFIGURATION);
00021 
00022     BlogSession::configureAuth();
00023 
00024     Wt::Dbo::SqlConnectionPool *blogDb
00025       = BlogSession::createConnectionPool(server.appRoot() + "blog.db");
00026 
00027     BlogRSSFeed rssFeed(*blogDb, "Wt and JWt blog",
00028                         "http://www.webtoolkit.eu/wt/blog",
00029                         "We care about our webtoolkits.");
00030 
00031     server.addResource(&rssFeed, "/wt/blog/feed/");
00032 
00033     server.addEntryPoint(Application,
00034                          boost::bind(&createJWtHomeApplication, _1, blogDb),
00035                          "/jwt", "/css/jwt/favicon.ico");
00036     server.addEntryPoint(Application,
00037                          boost::bind(&createWtHomeApplication, _1, blogDb),
00038                          "", "/css/wt/favicon.ico");
00039 
00040     server.run();
00041 
00042     delete blogDb;
00043   } catch (Wt::WServer::Exception& e) {
00044     std::cerr << e.what() << std::endl;
00045   } catch (std::exception &e) {
00046     std::cerr << "exception: " << e.what() << std::endl;
00047   }
00048 }

Generated on Tue Mar 22 2016 for the C++ Web Toolkit (Wt) by doxygen 1.7.6.1