Formatter for responses. Create a formatter for each type of Content-Type
$ elefrant install elefrant-responseCopy codes.js from ./components/elefrant-response to main config folder.
Activate the component.
Create your own formatter:
- Create new file in
elefrant-response/lib/format/json.js - Develop the code:
return function customizedFormatJSON(req, res, body) {
...
return data;
}MIT © Elefrant