Skip to content

Commit

Permalink
add routes template
Browse files Browse the repository at this point in the history
  • Loading branch information
Alfred J. Kwak committed Feb 13, 2017
1 parent 93ad181 commit 26ba532
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions generators/app/templates/server/routes.js
Original file line number Diff line number Diff line change
@@ -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
}
},<% } %>
});
<% } %>

0 comments on commit 26ba532

Please # to comment.