Open jkm opened 9 years ago
I assume you are referring to middleware? There is a basic form of implementing middleware with the webinterface and possible restinterface but i do not find that to be a very clean implementation. Refer to https://github.com/rejectedsoftware/vibe.d/blob/master/examples/web/source/app.d#L54 .
Yes. In Rack they call these units of functionality middleware. I want to build flexible flows. I think it also the applies to non-web stuff. I used to work with the click modular router. There you have a similar concept. Each block does a specific unit of work on packets and you just configure the packet processing on top using these basic elements. From the link I cannot tell how that relates to this here. But it may go in the direction I need it. I think this would extend vibe's applications enormously and lead to simpler code.
Adding on to this discussion I think this would be very useful. If it is currently possible then some examples would be awesome. My use case would be for example logging requests. If I want to print to std(out|err) in dev then having some handler that's called before and after each request and logs information about it would be great, but I currently don't see an easy way of doing this without maybe extending the router.
I need to set some headers to control caching of a web site. What's the recommended way to do this? I'm thinking about stacking the requests, e.g., the server request is first handled by function a, next it is handled by function b, etc. In essence I want the flexibility of Rack.
How would you go about that?