Skip to content

Commit

Permalink
default requests to index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
w33ble committed Apr 20, 2014
1 parent 6044709 commit 51a695c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/serve/createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ var exec = require('child_process').exec;

module.exports = function (port, lrPort, open, next) {
var server = http.createServer(function(req, res) {
var filePath = path.join(process.cwd(), req.url);
var request = (req.url === '/') ? '/index.html' : req.url;
var filePath = path.join(process.cwd(), request);
var mimetype = mime.lookup(filePath);
var fileStream = fs.createReadStream(filePath);

Expand Down

0 comments on commit 51a695c

Please sign in to comment.