Merge pull request #5 from tgpethan/esl+index-fix
Add back ESL remote check and fix index errors
This commit is contained in:
commit
407f9ddf89
1 changed files with 4 additions and 1 deletions
5
EUS.js
5
EUS.js
|
@ -78,6 +78,8 @@ module.exports = {
|
||||||
res - Response from server
|
res - Response from server
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (req.query["stat"] == "get") return res.end('{ "status":1, "version":"'+global.internals.version+'" }');
|
||||||
|
|
||||||
// Register the time at the start of the request
|
// Register the time at the start of the request
|
||||||
d = new Date();
|
d = new Date();
|
||||||
startTime = d.getTime();
|
startTime = d.getTime();
|
||||||
|
@ -87,7 +89,8 @@ module.exports = {
|
||||||
fs.access(__dirname + BASE_PATH + "/i/"+urs+image_json[urs], error => {
|
fs.access(__dirname + BASE_PATH + "/i/"+urs+image_json[urs], error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
// Doesn't exist, handle request normaly
|
// Doesn't exist, handle request normaly
|
||||||
fs.access(__dirname + BASE_PATH + "/files"+req.url, error => {
|
if (req.url === "/") { urs = "/index.html" } else { urs = req.url };
|
||||||
|
fs.access(__dirname + BASE_PATH + "/files"+urs, error => {
|
||||||
if (error) {
|
if (error) {
|
||||||
// Doesn't exist, send a 404 to the client.
|
// Doesn't exist, send a 404 to the client.
|
||||||
res.status(404).end("404!");
|
res.status(404).end("404!");
|
||||||
|
|
Loading…
Reference in a new issue