43 config.
read(
"config.ini");
45 cerr <<
"Could not read config.ini file: " << e.
getMessage() << endl;
53 Log::setOutputLevel(Log::Level::WARNING);
59 auto handlingFunction = [](
Connection& connection) ->
int {
63 connection.responseStream() <<
"Hello World!";
68 unique_ptr<RequestHandler> requestHandler;
71 requestHandler = RequestHandler::newRequestHandler(handlingFunction, config, 1);
73 cerr <<
"NAWA request handler could not be created: " << e.
getMessage() << endl;
85 requestHandler->setAccessFilters(accessFilters);
90 requestHandler->start();
92 cerr <<
"NAWA request handling could not be started: " << e.
getMessage() << endl;
109 requestHandler->join();
Response object to be passed back to NAWA and accessor to the request.
Exception class that can be used by apps to catch errors resulting from nawa function calls.
Simple class for (not (yet) thread-safe) logging to stderr or to any other output stream.
Handles and serves incoming requests via the NAWA app.
void read(std::string const &iniFile)
virtual std::string getMessage() const noexcept