Messing around with Node.js and Express. I just have the following right now:
app.get('*', function(req, res) {
});
which should catch all urls. What's the best way to exclude static files -- that end in .css, .js and .png (or perhaps begin with "css/", "js/" and "img/") ?
Don't put your static files in ./views, put them in ./public and add this line.
app.use(express.static(path.join(__dirname, 'public')));
That's all you need, you don't need anything else.
p.s. This line should be above app.use(app.router);