| 36 | }; |
| 37 | |
| 38 | struct RequestAppend : crow::ILocalMiddleware |
| 39 | { |
| 40 | // Values from this context can be accessed from handlers |
| 41 | struct context |
| 42 | { |
| 43 | std::string message; |
| 44 | }; |
| 45 | |
| 46 | void before_handle(crow::request& /*req*/, crow::response& /*res*/, context& /*ctx*/) |
| 47 | {} |
| 48 | |
| 49 | void after_handle(crow::request& /*req*/, crow::response& res, context& ctx) |
| 50 | { |
| 51 | // The response can be modified |
| 52 | res.write(" + (" + ctx.message + ")"); |
| 53 | } |
| 54 | }; |
| 55 | |
| 56 | int main() |
| 57 | { |
nothing calls this directly
no outgoing calls
no test coverage detected