CleverStack / angular-seed

The AngularJS based Modular Frontend for CleverStack, MEAN and so much more
http://youtube.com/watch?v=-4ArURHExhQ
MIT License
118 stars 36 forks source link

Getting an error "Fatal error: EISDIR, read" while trying to open test link #34

Closed rinatio closed 10 years ago

rinatio commented 10 years ago

2013-09-27 18 06 15

pilsy commented 10 years ago

I need more info, are your bower components setup? is all the node modules installed without error? what was the url????

leostera commented 10 years ago

Hey @rinatio that's because the moment you tried to access that specific url the webserver tried to read a folder and stream it over, which of course breaks everything.

A fix would be something like this:

var dir = fs.statSync(pathToDir);
if(dir.isDirectory()) {
  // forget it, we're not streaming a folder
  next();
}

Ideally there'd be a "url rewrite" so you can just access the test runner on :9090 without needing the rest of the url. A fix for that would be something like:

if( req.xhr || /base/.test(url) ) {  // ajax or url explicitly points to app
  pipe() // pipe the file over
} else {
  pipe() // pipe the test runner
}

After that you'd only go to localhost:9090 and it'd be resolved for you. Conditions for that if-clause definitely need to be adjusted but it gives you an idea.

rinatio commented 10 years ago

Yep, it was localhost:9090 instead of localhost:9090/test/e2e/runner.html. The second one is not giving an error. Please close if it isn't an issue

leostera commented 10 years ago

It is. I cannot fix it but maybe you can submit a pull request with the guidelines I posted over :) ?

deleteman commented 10 years ago

I've submitted a PR for this, would that fix this "issue"? https://github.com/clevertech/cleverstack-angular-seed/pull/41

durango commented 10 years ago

Closing ticket, this should be fixed by now... please re-open if it's not :)