You could try express.get('/foo', express_lib('static')(__dirname + '/hello'));
I don't think that worked quite right the last time I tried it, but the recent refactoring and clean-up for Connect 1.0 may have changed that.
> #2
> How can I tell if a file has been serve as static? I am doing this for
> some custom routing:
>
> express.get(/.*/, function(req, res) {
>
> And that catches static files, even though they are still being served
> correctly with the static providing code. Can I tell if if a file has
> already been handled, or prevent static files from hitting .get
> and .post actions?
Make sure that if you're installing the 'router' middleware, you install it *after* all 'static' middlewares, and that all your 'static' middlewares are added before you create any routes. If the 'static' middleware handles a request, if doesn't call next(), so provided the stack is ordered correctly you shouldn't set that behaviour.
If you already have your stack set up that way, post a link to a gist with minimal code that reproduces/demonstrates the problem.
--
Laurie Harper
http://laurie.holoweb.net/
--
You received this message because you are subscribed to the Google Groups "Express" group.
To post to this group, send email to expre...@googlegroups.com.
To unsubscribe from this group, send email to express-js+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/express-js?hl=en.