From 4fc9fc5b2b7489a31752669c872a343d19f9b2d4 Mon Sep 17 00:00:00 2001 From: Marcin Limanski Date: Wed, 15 Jun 2016 13:45:38 +0100 Subject: [PATCH] fixed the express issue, added suport for dynamic port --- samples/express/hello-world.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/samples/express/hello-world.js b/samples/express/hello-world.js index 60d75a9..8979c75 100644 --- a/samples/express/hello-world.js +++ b/samples/express/hello-world.js @@ -3,10 +3,12 @@ * Express must be installed for this sample to work */ +var port = Number(process.env.PORT || 3000); + var tropowebapi = require('tropo-webapi'); var express = require('express'); -var app = express.createServer(); +var app = express(); app.post('/', function(req, res){ // Create a new instance of the TropoWebAPI object. @@ -18,5 +20,5 @@ app.post('/', function(req, res){ }); -app.listen(8000); -console.log('Server running on http://0.0.0.0:8000/') \ No newline at end of file +app.listen(port); +console.log('Server running on: ' + port);