Skip to content
This repository has been archived by the owner on Sep 14, 2022. It is now read-only.

Show correct demo url while basePath is altered #519

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions project-skeletons/connect/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ module.exports = new Promise(function (resolve, reject) {
app.listen(port);

if (swaggerConnect.runner.swagger.paths['/hello']) {
console.log('try this:\ncurl http://127.0.0.1:' + port + '/hello?name=Scott');
var basePath = swaggerConnect.runner.swagger.basePath || '';
console.log('try this:\ncurl http://127.0.0.1:' + port + basePath + '/hello?name=Scott');
}
resolve(app);
});
});
});
5 changes: 3 additions & 2 deletions project-skeletons/express/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ module.exports = new Promise(function (resolve, reject) {
var port = process.env.PORT || 10010;
app.listen(port, function() {
if (swaggerExpress.runner.swagger.paths['/hello']) {
console.log('try this:\ncurl http://127.0.0.1:' + port + '/hello?name=Scott');
let basePath = swaggerExpress.runner.swagger.basePath || '';
console.log('try this:\ncurl http://127.0.0.1:' + port + basePath + '/hello?name=Scott');
}
resolve(app);
});
});
});
});
3 changes: 2 additions & 1 deletion project-skeletons/hapi/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ module.exports = new Promise(function (resolve, reject) {
}
app.start(function () {
if (swaggerHapi.runner.swagger.paths['/hello']) {
console.log('try this:\ncurl http://127.0.0.1:' + port + '/hello?name=Scott');
var basePath = swaggerHapi.runner.swagger.basePath || '';
console.log('try this:\ncurl http://127.0.0.1:' + port + basePath + '/hello?name=Scott');
}
resolve(app);
});
Expand Down
5 changes: 3 additions & 2 deletions project-skeletons/restify/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ module.exports = new Promise(function (resolve, reject) {
var port = process.env.PORT || 10010;
app.listen(port, function () {
if (swaggerRestify.runner.swagger.paths['/hello']) {
console.log('try this:\ncurl http://127.0.0.1:' + port + '/hello?name=Scott');
var basePath = swaggerRestify.runner.swagger.basePath || '';
console.log('try this:\ncurl http://127.0.0.1:' + port + basePath + '/hello?name=Scott');
}
resolve(app);
});
});
});
});