MCPcopy Create free account
hub / github.com/CrowCpp/Crow / RequestAppend

Class RequestAppend

examples/example_middleware.cpp:38–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36};
37
38struct 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
56int main()
57{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected