diff options
Diffstat (limited to 'include/middleware.h')
-rw-r--r-- | include/middleware.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/middleware.h b/include/middleware.h index 270e026..5e358af 100644 --- a/include/middleware.h +++ b/include/middleware.h @@ -4,6 +4,21 @@ namespace crow { + // Any middleware requires following 3 members: + + // struct context; + // storing data for the middleware; can be read from another middleware or handlers + + // template <typename AllContext> + // void before_handle(request& req, response& res, context& ctx, AllContext& all_ctx) + // called before handling the request. + // if res.end() is called, the operation is halted. + // (still call after_handle of this middleware) + + // template <typename AllContext> + // void after_handle(request& req, response& res, context& ctx, AllContext& all_ctx) + // called after handling the request. + class CookieParser { struct context |