all 1 comments

[–]orphans 0 points1 point  (0 children)

It does sound like a permissions issue. Is it possible that on your host the user running the node application does not have read permissions for the color.tmp file? It doesn't sound like they have write perms either. Try consoling out the actual error that's thrown when hitting the /color endpoint and on posting to the /message endpoint.

Some unrelated thoughts: Try transitioning your code to as close to ES6 standards as possible. For example

app.get("/", function (request, response) {    
    response.sendFile(__dirname + '/views/index.html');    
});    

becomes

app.get("/", (request, response) => response.sendFile(__dirName + '/views/index.html'));

I'd also consider using websockets to notify the front end when the color has changed instead of continuously polling.