diff --git a/lib/reload-server.js b/lib/reload-server.js index fd0c54c..f9e02ee 100644 --- a/lib/reload-server.js +++ b/lib/reload-server.js @@ -25,13 +25,13 @@ router.get('/', function (req, res, next) { // Create the start page path. var startFile = path.join(dir, startPage) - fs.exists(startFile, function (itDoes) { - // If the start page exists send the reload-client code to the HTML. - if (itDoes) { - sendhtml(startFile, res) - } else { - // Else the start page doesn't exist (whether it's the deault index.html or specified). + fs.access(startFile, function (err) { + // If the start page doesn't exist (whether it's the deault index.html or specified). + if (err) { res.status(404).send("Can't find " + startPage) + } else { + // Else the start page exists send the reload-client code to the HTML. + sendhtml(startFile, res) } }) }) diff --git a/package.json b/package.json index 0b7dcef..c9d77ab 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "minimist": "~1.2.0" }, "devDependencies": { - "standard": "^7.1.2" + "standard": "^10.0.2" }, "main": "./lib/reload.js", "scripts": {