Commit 5c7a9758 authored by Ricco Førgaard's avatar Ricco Førgaard
Browse files

Root will return index.html

parent cf45ede7
......@@ -26,13 +26,16 @@ var root = './www',
serveFile = function (path, response) {
console.log("Serving index.html");
fs.readFile(root + path, function (err, file) {
var realPath = (path === '/')
? '/index.html'
: path;
fs.readFile(root + realPath, function (err, file) {
if (err || isNotAfile(file)) {
write404(response);
} else {
writeFileResponse(path, file, response);
writeFileResponse(realPath, file, response);
}
});
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment