This way, we're transforming the api call's response, and passing it to a mustache view to be used there, and then returning the result if the user calls for the "web". But if the user requests for "api", the middleware won't happen.
This is an excellent idea that will help the users to provide an API and at the same time enable Server Side Rendering.
Of course, the syntax for registering the middlewares/transformers are decided yet.
I would like the Transformer idea to be the same as Middleware idea.
Imagine this scenario:
You have an app, that has API and a view.
The normal html website will require the same json values that are provided in the API.
This way, we're transforming the api call's response, and passing it to a mustache view to be used there, and then returning the result if the user calls for the "web". But if the user requests for "api", the middleware won't happen.
This is an excellent idea that will help the users to provide an API and at the same time enable Server Side Rendering.
Of course, the syntax for registering the middlewares/transformers are decided yet.
I would like the Transformer idea to be the same as Middleware idea.