|
|
| App (std::shared_ptr< ContextType > dataStore, AppConfig &&conf={}, std::optional< raven::SSLConfig > &&sslConfig=std::nullopt) |
|
template<typename = std::enable_if<std::is_trivially_default_constructible_v<ContextType>>> |
| | App (AppConfig &&conf={}, std::optional< raven::SSLConfig > &&sslConfig=std::nullopt) |
| template<routing::FixedString path, Method::HttpMethod method> |
| routing::BaseRoute< ContextType > * | route (const routing::RouteCallback< path, ContextType > &callback) |
| void | run () override |
| void | shutdown () override |
|
uint16_t | getPort () |
|
void | sync () |
| const routing::BaseRouter & | getRouter () override |
| data::CommonData * | getContext () const override |
|
void | registerGlobalMiddlewares (const std::vector< std::shared_ptr< Middleware< ContextType > > > &middlewares) |
| Middlewares< ContextType > * | getMiddlewaresAsPtr () override |
|
| ContextApp (AppConfig &&config) |
|
void | useNotFoundErrorHandler () |
|
void | use500ErrorHandler () |
|
| BaseApp (AppConfig &&config) |
|
const AppConfig & | getConfig () |
◆ getContext()
template<data::IsCommonData ContextType = data::CommonData>
◆ getMiddlewaresAsPtr()
template<data::IsCommonData ContextType = data::CommonData>
◆ getRouter()
template<data::IsCommonData ContextType = data::CommonData>
◆ route()
template<data::IsCommonData ContextType = data::CommonData>
Adds a route.
Each call to this method is only allowed to specify one HTTP method. This is because it's considered bad practice to support more than one HTTP method per function call. However, you can still get around this by calling the route function several times with the same function.
HTTP methods have distinct meanings per the standard. It's therefore arguably never appropriate to use the same handler for different methods. If you have code in common, instead of using the same handler, move that code into reusable modules.
- Returns
- A BaseRoute instance that can be used for some further configuration.
◆ run()
template<data::IsCommonData ContextType = data::CommonData>
◆ shutdown()
template<data::IsCommonData ContextType = data::CommonData>
The documentation for this class was generated from the following file: