@axway/api-builder-runtime
Version:
API Builder Runtime
20 lines (16 loc) • 444 B
JavaScript
exports.types = [ 'text/plain' ];
/**
* Formats the response as plain JSON text.
* @param req
* @param resp
* @param body
* @param singluar
* @param plural
* @param callback
*/
exports.format = function plainFormatter(req, resp, body, singluar, plural, callback) {
resp && resp.set('Content-Type', 'text/plain');
callback(null, JSON.stringify(body, null, 2));
};
exports.extensions = 'txt';
exports.defaultMimeType = 'text/plain';