0

I have a public folder with avatars ...

127.0.0.1/avatar/5928369292385

It's okay for existing files but when the file is missing:

Cannot GET /avatar/ef7649059214769a0fefew

How can i return a default image of my choosing when requests are made for non existing files?

Aleksandrenko
  • 2,987
  • 6
  • 28
  • 34
  • 1
    Can you please post the code for your routed function? ( app.get(..THIS..) ) ; or is it a static function? – Danilo Ramirez Feb 07 '14 at 18:42
  • http://stackoverflow.com/questions/980855/inputting-a-default-image-in-case-the-src-arribute-of-an-html-img-is-not-valid – Josh C. Feb 07 '14 at 19:05
  • It is in the static/public folder. – Aleksandrenko Feb 08 '14 at 08:21
  • Try with the answer to this other question [stackoverflow.com/questions/14124924/node-js-express-sending-static-files-if-they-exist](http://stackoverflow.com/questions/14124924/node-js-express-sending-static-files-if-they-exist) – Danilo Ramirez Feb 10 '14 at 14:59

0 Answers0