Wexus2 0.20
|
#include <Site.h>
Classes | |
class | error |
Public Member Functions | |
Site (const QString &siteDir, const wexus::HTTPParams ¶ms=wexus::HTTPParams()) | |
~Site () | |
destructor | |
bool | isRunning (void) const |
is the web server currently running? | |
void | start (void) |
starts the web server | |
void | quit (void) |
void | wait (void) |
waits until the server finishes | |
void | addApplication (const QString &mountpoint, std::shared_ptr< wexus::Application > app) |
This is the core engine class of wexus. A wexus::Site represents 1 or more running wexus::Application instanced groupped with a wexus::HTTPServer.
This will instante certain singltons too, if needed: MimeTypes.
wexus::Site::Site | ( | const QString & | siteDir, |
const wexus::HTTPParams & | params = wexus::HTTPParams() |
||
) |
Creates site instance based on the given siteDir. The siteDir can be empty or already populated with a site.
Exceptions are thrown on errors.
You should call start() when you want to start the internal httpserver.
void wexus::Site::addApplication | ( | const QString & | mountpoint, |
std::shared_ptr< wexus::Application > | app | ||
) |
Adds an already instantiated application to the given mount point. The mountpoint must end in a '/'. The root mountpoint, "/" is fine too.
void wexus::Site::quit | ( | void | ) |
notifies the web server to stop. you should still do a wait() this function may or may not block