12345678910111213141516 |
- <%#
- //example cppsp module that causes all pages to be served as static pages
- DelegateChain<void(Request&, Response&, Delegate<void()>)>::item* it;
- Server* server;
- void handleRequest(void*, Request& req, Response& resp, Delegate<void()> cb) {
- server->handleStaticRequest(req.path,req,resp,cb);
- }
- extern "C" void initModule(Server* s) {
- server=s;
- it=s->handleRequest.attach(&handleRequest);
- }
- extern "C" void deinitModule() {
- server->handleRequest.detach(it);
- }
- %>
|