diff --git a/generators/app/templates/server/routes.js b/generators/app/templates/server/routes.js new file mode 100644 index 0000000..d5583f7 --- /dev/null +++ b/generators/app/templates/server/routes.js @@ -0,0 +1,19 @@ +import Api from './api'; +<% for (var p in api.paths) { %> +Api.addRoute('<%= p %>', {}, {<% for (var e in api.paths[p]) { %> +<%= e %>: { + swagger: { + tags: ['<%= api.paths[p][e].tags %>'], + description: '<%= api.paths[p][e].description %>', + responses: {<% for (var r in api.paths[p][e].responses) { %> + <%= r %>: { + description: '<%= api.paths[p][e].responses[r].description %>', + },<% } %> + }, + }, + action: function () { + // Write controller action here + } + },<% } %> +}); +<% } %>