diff --git a/build.sh b/build.sh index 0d2013b3a3..2685388292 100755 --- a/build.sh +++ b/build.sh @@ -2,4 +2,5 @@ rm -rf node_modules npm install . -./node_modules/.bin/bower install \ No newline at end of file +./node_modules/.bin/bower install +./node_modules/.bin/gulp \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 44c5f3b57a..be06b3bd80 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -116,6 +116,7 @@ gulp.task('scripts', [ ]); } src = src.concat([ + 'app/tidepoolplatform.js', 'dist/tmp/app.js', 'app/start.js' ]); diff --git a/server.js b/server.js index 8916c80287..c0c783e27a 100644 --- a/server.js +++ b/server.js @@ -5,8 +5,10 @@ var buildDir = 'dist'; var app = connect(); -app.use(connect.static(__dirname + '/' + buildDir)); +var staticDir = __dirname + '/' + buildDir; +app.use(connect.static(staticDir)); -http.createServer(app).listen(3000); -console.log('Connect server started on port 3000'); -console.log('Serving static directory "' + buildDir + '/"'); \ No newline at end of file +var server = http.createServer(app).listen(process.env.PORT || 3000, function() { + console.log('Connect server started on port', server.address().port); + console.log('Serving static directory "' + staticDir + '/"'); +}); \ No newline at end of file diff --git a/start.sh b/start.sh index 91f5c8de7d..6284f30f62 100755 --- a/start.sh +++ b/start.sh @@ -1,4 +1,4 @@ #! /bin/bash -eu . config/env.sh -exec node develop \ No newline at end of file +exec node server \ No newline at end of file