Permalink
Browse files

[bin] Added bin/server

  • Loading branch information...
1 parent 670f9ab commit acbca3b3369d2598c0f2392a4a8a1f730a11020b @indexzero indexzero committed Nov 26, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 bin/server
View
@@ -0,0 +1,21 @@
+#!/usr/bin/env node
+
+var port = process.env.PORT || process.env.C9_PORT || 8080;
+
+var server = require('http-server').createServer({
+ root: './public/',
+ ext: 'html'
+});
+
+server.listen(process.env.PORT || process.env.C9_PORT || 8080, function () {
+ console.log('Starting up http-server, serving '
+ + server.root
+ + ' on port: '
+ + port);
+ console.log('Hit CTRL-C to stop the server');
+});
+
+process.on('SIGINT', function() {
+ console.log('http-server stopped.');
+ return process.exit();
+});

0 comments on commit acbca3b

Please sign in to comment.