Skip to content

Commit

Permalink
Use compiled assets when deploying with shio
Browse files Browse the repository at this point in the history
- Add `tidepoolplatform.js` to build process
- Modify `server.js` to run on other port values
- Add build step and run static connect server in shio scripts
  • Loading branch information
nicolashery committed Feb 15, 2014
1 parent f0ef620 commit 189e189
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

rm -rf node_modules
npm install .
./node_modules/.bin/bower install
./node_modules/.bin/bower install
./node_modules/.bin/gulp
1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ gulp.task('scripts', [
]);
}
src = src.concat([
'app/tidepoolplatform.js',
'dist/tmp/app.js',
'app/start.js'
]);
Expand Down
10 changes: 6 additions & 4 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 + '/"');
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 + '/"');
});
2 changes: 1 addition & 1 deletion start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /bin/bash -eu

. config/env.sh
exec node develop
exec node server

0 comments on commit 189e189

Please sign in to comment.