Permalink
Browse files

Update server to use connect serve-static

  • Loading branch information...
1 parent c16206c commit 47de03929b161a90d39f1cdb2c179f397467d407 @interactivellama interactivellama committed Jan 16, 2015
Showing with 12 additions and 4 deletions.
  1. +12 −4 devserver.js
View
@@ -1,7 +1,15 @@
-var util = require('util'),
- connect = require('connect'),
- port = 9000;
+var util = require('util');
+var connect = require('connect');
+var serveStatic = require('serve-static');
+var path = require('path');
-connect.createServer(connect.static(__dirname)).listen(process.env.PORT || port);
+var port = 9000;
+var app = connect();
+
+// parent folder
+app.use(serveStatic(path.resolve(__dirname)));
+
+// Listen
+app.listen(process.env.PORT || port);
util.puts('Listening on ' + (process.env.PORT || port) + '...');
util.puts('Press Ctrl + C to stop.');

0 comments on commit 47de039

Please sign in to comment.