mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-11-21 11:03:55 +00:00
* read directly from templates * refactor nodejs structure * dont inject into global scope * move to 2 spaces consistently
22 lines
617 B
Plaintext
22 lines
617 B
Plaintext
'use strict';
|
|
|
|
var utils = require('../utils/writer.js');
|
|
{{#operations}}
|
|
var {{classname}} = require('../{{implFolder}}/{{classname}}Service');
|
|
{{#operation}}
|
|
|
|
module.exports.{{nickname}} = function {{nickname}} (req, res, next) {
|
|
{{#allParams}}
|
|
var {{paramName}} = req.swagger.params['{{baseName}}'].value;
|
|
{{/allParams}}
|
|
{{classname}}.{{nickname}}({{#allParams}}{{paramName}}{{#hasMore}},{{/hasMore}}{{/allParams}})
|
|
.then(function (response) {
|
|
utils.writeJson(res, response);
|
|
})
|
|
.catch(function (response) {
|
|
utils.writeJson(res, response);
|
|
});
|
|
};
|
|
{{/operation}}
|
|
{{/operations}}
|