diff --git a/examples/hello-world/index.js b/examples/hello-world/index.js index 23bcda999e32..2800ea495ada 100644 --- a/examples/hello-world/index.js +++ b/examples/hello-world/index.js @@ -9,7 +9,17 @@ module.exports = application; if (require.main === module) { // Run the application - application.main().catch(err => { + const config = { + rest: { + port: +process.env.PORT || 3000, + host: process.env.HOST || 'localhost', + openApiSpec: { + // useful when used with OASGraph to locate your application + setServersFromRequest: true, + }, + }, + }; + application.main(config).catch(err => { console.error('Cannot start the application.', err); process.exit(1); }); diff --git a/examples/soap-calculator/index.js b/examples/soap-calculator/index.js index 12484ccad1c7..78018fcf4412 100644 --- a/examples/soap-calculator/index.js +++ b/examples/soap-calculator/index.js @@ -4,7 +4,17 @@ module.exports = application; if (require.main === module) { // Run the application - application.main().catch(err => { + const config = { + rest: { + port: +process.env.PORT || 3000, + host: process.env.HOST || 'localhost', + openApiSpec: { + // useful when used with OASGraph to locate your application + setServersFromRequest: true, + }, + }, + }; + application.main(config).catch(err => { console.error('Cannot start the application.', err); process.exit(1); }); diff --git a/examples/todo-list/index.js b/examples/todo-list/index.js index f60622546c19..d9b161f4c190 100644 --- a/examples/todo-list/index.js +++ b/examples/todo-list/index.js @@ -9,6 +9,16 @@ module.exports = application; if (require.main === module) { // Run the application + const config = { + rest: { + port: +process.env.PORT || 3000, + host: process.env.HOST || 'localhost', + openApiSpec: { + // useful when used with OASGraph to locate your application + setServersFromRequest: true, + }, + }, + }; application.main().catch(err => { console.error('Cannot start the application.', err); process.exit(1); diff --git a/examples/todo/index.js b/examples/todo/index.js index 08ea81118b44..35bffe4aca7a 100644 --- a/examples/todo/index.js +++ b/examples/todo/index.js @@ -9,7 +9,17 @@ module.exports = application; if (require.main === module) { // Run the application - application.main().catch(err => { + const config = { + rest: { + port: +process.env.PORT || 3000, + host: process.env.HOST || 'localhost', + openApiSpec: { + // useful when used with OASGraph to locate your application + setServersFromRequest: true, + }, + }, + }; + application.main(config).catch(err => { console.error('Cannot start the application.', err); process.exit(1); });