|
@@ -69,12 +69,25 @@ namespace kbf {
|
|
|
|
|
|
class Middleware;
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Adds a #Middleware to the service.
|
|
|
+ *
|
|
|
+ * @tparam T Middleware class
|
|
|
+ */
|
|
|
template<class T>
|
|
|
void middleware() {
|
|
|
static_assert(std::is_base_of<Middleware, T>::value, "middleware(): type must be a Middleware");
|
|
|
middlewares.push_back(new T());
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @brief Continue execution of the middleware pipeline.
|
|
|
+ *
|
|
|
+ * @note Should be called from middlewares if you want the pipeline to continue.
|
|
|
+ *
|
|
|
+ * @param request
|
|
|
+ * @return response
|
|
|
+ */
|
|
|
http::Response next(const http::Request &request);
|
|
|
|
|
|
/**
|