swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

Error in node.js index.mustache template

Open oYo-fr opened this issue 11 years ago • 2 comments

In nodejs file index.js when generating a node.js server, the variable serverPort is never used. In file /modules/swagger-codegen/src/main/resources/nodejs/index.mustache, which seems to be the template for this file, I think we should have this (lines 34 to 37):

http.createServer(app).listen(serverPort, function () { console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort); console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort); });

Instead of this:

http.createServer(app).listen({{serverPort}}, function () { console.log('Your server is listening on port %d (http://localhost:%d)', {{serverPort}}, {{serverPort}}); console.log('Swagger-ui is available on http://localhost:%d/docs', {{serverPort}}); });

... notice the removal of {{ }} surrounding the "serverPort" variable.

oYo-fr avatar Oct 07 '15 14:10 oYo-fr

@oYo-fr I agree that the variable serverPort should be used instead of {{serverPort}}. Do you have cycle to submit a PR for the change?

wing328 avatar Oct 08 '15 02:10 wing328

Hi wing328,

I would love to make a pull request but I simply don't know how to do it :(

I suck at git :-/

oYo-fr avatar Oct 08 '15 08:10 oYo-fr