redirect to index.html - single page

This commit is contained in:
Mario Romano
2016-07-14 20:50:38 +01:00
parent ef8a46fec4
commit 8fae7d1c34

View File

@@ -36,7 +36,7 @@ var server = http.createServer(function (req, res) {
}); });
} else { } else {
var filename = pathname.substr(1); var filename = pathname.substr(1);
if(filename === ''){ if(filename === '' || filename.indexOf('.') === -1){
filename = 'index.html'; filename = 'index.html';
} }
// Read the requested file content from file system // Read the requested file content from file system