handlebars.nodejs.controller.mustache Maven / Gradle / Ivy
'use strict';
var utils = require('../utils/writer.js');
{{#operations}}
var {{classname}} = require('../{{implFolder}}/{{classname}}Service');
{{#operation}}
{{#contents}}
module.exports.{{nickname}} = function {{nickname}} (req, res, next{{#parameters}}{{#@first}}, {{/@first}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}}) {
{{classname}}.{{nickname}}({{#parameters}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/parameters}})
.then(function (response) {
utils.writeJson(res, response);
})
.catch(function (response) {
utils.writeJson(res, response);
});
};
{{/contents}}
{{/operation}}
{{/operations}}