Created UserInterface namespace, WebServerService -> UserInterfaceService.
This commit is contained in:
+11
-31
@@ -1,26 +1,18 @@
|
||||
#include <memory>
|
||||
#include <Wt/WServer>
|
||||
#include <Wt/WIOService>
|
||||
#include <csignal>
|
||||
|
||||
#include "transcode/AvConvTranscoder.hpp"
|
||||
#include "av/Common.hpp"
|
||||
|
||||
#include "ServiceManager.hpp"
|
||||
#include "DatabaseRefreshService.hpp"
|
||||
#include "WebServerService.hpp"
|
||||
#include "UserInterfaceService.hpp"
|
||||
#include "RemoteServerService.hpp"
|
||||
|
||||
#include "ui/LmsApplication.hpp"
|
||||
|
||||
static Wt::WApplication *createApplication(const Wt::WEnvironment& env)
|
||||
{
|
||||
/*
|
||||
* You could read information from the environment to decide whether
|
||||
* the user has permission to start a new application
|
||||
*/
|
||||
std::cout << "Creating new Application" << std::endl;
|
||||
return new LmsApplication(env);
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
@@ -28,32 +20,20 @@ int main(int argc, char* argv[])
|
||||
|
||||
try
|
||||
{
|
||||
// ServiceManager serviceManager;
|
||||
ServiceManager serviceManager;
|
||||
|
||||
// TODO Retreive the database path in some config file
|
||||
const boost::filesystem::path dbPath("test.db");
|
||||
|
||||
// lib init
|
||||
Av::AvInit();
|
||||
Transcode::AvConvTranscoder::init();
|
||||
|
||||
return Wt::WRun(argc, argv, createApplication);
|
||||
/* Wt::WServer server(argv[0], "");
|
||||
serviceManager.startService( std::make_shared<DatabaseRefreshService>( dbPath) );
|
||||
serviceManager.startService( std::make_shared<UserInterfaceService>(argc, argv, dbPath) );
|
||||
serviceManager.startService( std::make_shared<RemoteServerService>( Remote::Server::Server::endpoint_type(), dbPath) );
|
||||
|
||||
server.setServerConfiguration(argc, argv, WTHTTP_CONFIGURATION);
|
||||
server.addEntryPoint(Wt::Application, createApplication);
|
||||
if (server.start()) {
|
||||
int sig = Wt::WServer::waitForShutdown(argv[0]);
|
||||
std::cerr << "Shutdown (signal = " << sig << ")" << std::endl;
|
||||
server.stop();
|
||||
if (sig == SIGHUP)
|
||||
Wt::WServer::restart(argc, argv, environ);
|
||||
}*/
|
||||
// return 0;
|
||||
|
||||
|
||||
// serviceManager.startService( std::make_shared<DatabaseRefreshService>( "test.db" ) );
|
||||
// serviceManager.startService( std::make_shared<WebServerService>(argc, argv) );
|
||||
// serviceManager.startService( std::make_shared<RemoteServerService>( Remote::Server::Server::endpoint_type() ) );
|
||||
|
||||
// serviceManager.run();
|
||||
serviceManager.run();
|
||||
|
||||
res = EXIT_SUCCESS;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user