Merge pull request #1360 from wing328/nodejs_server_port

[NodeJS] update index.js to use the var serverPort
This commit is contained in:
wing328 2015-10-09 11:32:01 +08:00
commit 42b716207f
3 changed files with 10 additions and 10 deletions

View File

@ -31,8 +31,8 @@ swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {
app.use(middleware.swaggerUi()); app.use(middleware.swaggerUi());
// Start the server // Start the server
http.createServer(app).listen({{serverPort}}, function () { http.createServer(app).listen(serverPort, function () {
console.log('Your server is listening on port %d (http://localhost:%d)', {{serverPort}}, {{serverPort}}); 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}}); console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort);
}); });
}); });

View File

@ -24,7 +24,7 @@ exports.placeOrder = function(body) {
"complete" : true, "complete" : true,
"status" : "aeiou", "status" : "aeiou",
"quantity" : 123, "quantity" : 123,
"shipDate" : "2015-09-03T14:34:08.343+0000" "shipDate" : "2015-10-08T15:56:08.367+0000"
}; };
@ -43,7 +43,7 @@ exports.getOrderById = function(orderId) {
"complete" : true, "complete" : true,
"status" : "aeiou", "status" : "aeiou",
"quantity" : 123, "quantity" : 123,
"shipDate" : "2015-09-03T14:34:08.347+0000" "shipDate" : "2015-10-08T15:56:08.371+0000"
}; };

View File

@ -31,8 +31,8 @@ swaggerTools.initializeMiddleware(swaggerDoc, function (middleware) {
app.use(middleware.swaggerUi()); app.use(middleware.swaggerUi());
// Start the server // Start the server
http.createServer(app).listen(8080, function () { http.createServer(app).listen(serverPort, function () {
console.log('Your server is listening on port %d (http://localhost:%d)', 8080, 8080); 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', 8080); console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort);
}); });
}); });