Nick Maroulis
Nick Maroulis

Reputation: 487

fs.exists() is both true and false

fs.exists(controller_path, function (exists) 
{
     util.debug( exists ? 'here' : 'not here' );
});

This is the example from the documentation. The file definitely exists but for each request, I recieve:

DEBUG: here
DEBUG: not here

Upvotes: 0

Views: 154

Answers (1)

Peter Lyons
Peter Lyons

Reputation: 146084

You have posted sample code but not the actual code you have. Don't expect much.

However, he's a shot-in-the-dark that I'm willing to bet is right:

You don't realize that the browser is sending 2 GET requests: 1 for "/" and a second for "/favicon.ico".

Upvotes: 3

Related Questions