#include <StaticMiddleware.h>
Public Member Functions | |
| StaticMiddleware (const StaticMiddleware &)=delete | |
| StaticMiddleware & | operator= (const StaticMiddleware &)=delete |
| StaticMiddleware & | setIndex (const std::string &index) |
| StaticMiddleware & | clearStdHeaders () |
| StaticMiddleware & | setStdHeaders (const std::map< std::string, std::string > &stdHeaders) |
| StaticMiddleware & | appendStdHeaders (const std::map< std::string, std::string > &stdHeaders) |
| StaticMiddleware & | appendStdHeaders (const std::string &field, const std::string &value) |
| StaticMiddleware & | appendStdCookie (const std::string &name, const std::string &value, const std::map< std::string, std::string > &options={}) |
| StaticMiddleware & | afterResponse (web::http::ConnectionState connectionState) |
| Public Member Functions inherited from express::Router | |
| Router () | |
| Router (const Router &)=default | |
| const Router & | setStrictRouting (bool strictRouting=true) const |
| const Router & | setCaseInsensitiveRouting (bool caseInsensitiveRouting=true) const |
| const Router & | setMergeParams (bool mergeParams=true) const |
| std::list< std::string > | getRoutes () const |
| Route & | use (const Router &router) const |
| Route & | use (const std::string &relativeMountPath, const Router &router) const |
| Route & | use (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | use (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | use (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | use (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | use (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | use (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | use (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | use (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | all (const Router &router) const |
| Route & | all (const std::string &relativeMountPath, const Router &router) const |
| Route & | all (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | all (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | all (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | all (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | all (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | all (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | all (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | all (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | get (const Router &router) const |
| Route & | get (const std::string &relativeMountPath, const Router &router) const |
| Route & | get (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | get (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | get (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | get (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | get (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | get (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | get (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | get (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | put (const Router &router) const |
| Route & | put (const std::string &relativeMountPath, const Router &router) const |
| Route & | put (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | put (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | put (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | put (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | put (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | put (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | put (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | put (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | post (const Router &router) const |
| Route & | post (const std::string &relativeMountPath, const Router &router) const |
| Route & | post (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | post (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | post (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | post (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | post (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | post (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | post (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | post (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | del (const Router &router) const |
| Route & | del (const std::string &relativeMountPath, const Router &router) const |
| Route & | del (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | del (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | del (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | del (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | del (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | del (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | del (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | del (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | connect (const Router &router) const |
| Route & | connect (const std::string &relativeMountPath, const Router &router) const |
| Route & | connect (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | connect (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | connect (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | connect (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | connect (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | connect (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | connect (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | connect (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | options (const Router &router) const |
| Route & | options (const std::string &relativeMountPath, const Router &router) const |
| Route & | options (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | options (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | options (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | options (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | options (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | options (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | options (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | options (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | trace (const Router &router) const |
| Route & | trace (const std::string &relativeMountPath, const Router &router) const |
| Route & | trace (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | trace (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | trace (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | trace (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | trace (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | trace (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | trace (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | trace (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | patch (const Router &router) const |
| Route & | patch (const std::string &relativeMountPath, const Router &router) const |
| Route & | patch (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | patch (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | patch (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | patch (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | patch (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | patch (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | patch (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | patch (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| Route & | head (const Router &router) const |
| Route & | head (const std::string &relativeMountPath, const Router &router) const |
| Route & | head (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | head (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda) const |
| Route & | head (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| Route & | head (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda) const |
| template<typename... Lambdas> | |
| Route & | head (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | head (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | head (const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
| template<typename... Lambdas> | |
| Route & | head (const std::string &relativeMountPath, const std::function< void(const std::shared_ptr< Request > &, const std::shared_ptr< Response > &, Next &)> &lambda, Lambdas... lambdas) const |
Protected Member Functions | |
| StaticMiddleware (const std::string &root) | |
Static Protected Member Functions | |
| static class StaticMiddleware & | instance (const std::string &root) |
Private Attributes | |
| std::string | root |
| std::string | index |
| std::map< std::string, std::string > | stdHeaders = {{"Cache-Control", "public, max-age=0"}, {"Accept-Ranges", "bytes"}} |
| std::map< std::string, web::http::CookieOptions > | stdCookies |
| web::http::ConnectionState | defaultConnectionState = web::http::ConnectionState::Default |
Friends | |
| class StaticMiddleware & | StaticMiddleware (const std::string &root) |
Additional Inherited Members | |
| Protected Attributes inherited from express::Router | |
| std::shared_ptr< RootRoute > | rootRoute = nullptr |
Definition at line 59 of file StaticMiddleware.h.
|
delete |
|
explicitprotected |
Definition at line 58 of file StaticMiddleware.cpp.
References web::http::Close, express::Response::cookie(), defaultConnectionState, core::socket::stream::SocketConnection::getConnectionName(), web::http::CookieOptions::getOptions(), core::socket::stream::SocketContext::getSocketConnection(), express::Response::getSocketContext(), web::http::CookieOptions::getValue(), index, web::http::Keep, express::Request::method, express::Next::operator()(), express::Request::originalPath, express::Request::path, express::Response::redirect(), root, express::Response::send(), express::Response::sendFile(), express::Response::sendStatus(), express::Response::set(), express::Response::set(), express::Router::setStrictRouting(), express::Response::status(), express::Request::url, and httputils::url_decode().
Referenced by instance().
| class StaticMiddleware & express::middleware::StaticMiddleware::afterResponse | ( | web::http::ConnectionState | connectionState | ) |
Definition at line 159 of file StaticMiddleware.cpp.
References defaultConnectionState.
| class StaticMiddleware & express::middleware::StaticMiddleware::appendStdCookie | ( | const std::string & | name, |
| const std::string & | value, | ||
| const std::map< std::string, std::string > & | options = {} ) |
Definition at line 151 of file StaticMiddleware.cpp.
References web::http::CookieOptions::CookieOptions(), and stdCookies.
| class StaticMiddleware & express::middleware::StaticMiddleware::appendStdHeaders | ( | const std::map< std::string, std::string > & | stdHeaders | ) |
Definition at line 139 of file StaticMiddleware.cpp.
References stdHeaders.
| class StaticMiddleware & express::middleware::StaticMiddleware::appendStdHeaders | ( | const std::string & | field, |
| const std::string & | value ) |
Definition at line 145 of file StaticMiddleware.cpp.
References stdHeaders.
| class StaticMiddleware & express::middleware::StaticMiddleware::clearStdHeaders | ( | ) |
Definition at line 127 of file StaticMiddleware.cpp.
References stdHeaders.
|
staticprotected |
Definition at line 165 of file StaticMiddleware.cpp.
References StaticMiddleware().
Referenced by StaticMiddleware.
|
delete |
| class StaticMiddleware & express::middleware::StaticMiddleware::setIndex | ( | const std::string & | index | ) |
Definition at line 121 of file StaticMiddleware.cpp.
References index.
| class StaticMiddleware & express::middleware::StaticMiddleware::setStdHeaders | ( | const std::map< std::string, std::string > & | stdHeaders | ) |
Definition at line 133 of file StaticMiddleware.cpp.
References stdHeaders.
|
friend |
Definition at line 177 of file StaticMiddleware.cpp.
References instance().
|
private |
Definition at line 84 of file StaticMiddleware.h.
Referenced by afterResponse(), and StaticMiddleware().
|
private |
Definition at line 81 of file StaticMiddleware.h.
Referenced by setIndex(), and StaticMiddleware().
|
private |
Definition at line 80 of file StaticMiddleware.h.
Referenced by StaticMiddleware().
|
private |
Definition at line 83 of file StaticMiddleware.h.
Referenced by appendStdCookie().
|
private |
Definition at line 82 of file StaticMiddleware.h.
Referenced by appendStdHeaders(), appendStdHeaders(), clearStdHeaders(), and setStdHeaders().