fixed runtime error on start node js server on old version of node.js

This commit is contained in:
MaximZaitsev
2016-07-15 12:08:29 +03:00
parent 1dd5d8c1c4
commit 76641f088d
+13 -8
View File
@@ -44,11 +44,16 @@ handle["/loadBin"] = handlers.loadBin;
handle["/control"] = handlers.control;
handle["/other"] = handlers.other;
/*fs.access(executeShell, fs.F_OK, function (error) {
if (!error) {
server.start(router.route, handle);
} else {
console.log("file " + executeShell + " not found. Copy this file to server root dir");
}
});*/
server.start(router.route, handle);
if (typeof fs.access == "function") {
fs.access(executeShell, fs.F_OK, function (error) {
if (!error) {
server.start(router.route, handle);
} else {
console.log("file " + executeShell + " not found. Copy this file to server root dir");
}
});
} else {
console.log("warning: you have old version of node.js. Check existence of the file st-flash on root of server dir yourself");
server.start(router.route, handle);
}
// server.start(router.route, handle);