I have my Express config nested in a folder like this: ./lib/config/config.js. When I try to do this:
app.use(express.static(__dirname + "/../../public"));
I get a Forbidden error for anything in the public folder.
When I move that use statement to a file in the root folder of my app and call it like this:
app.use(express.static(__dirname + "/public"));
it works perfectly fine. It used to work both ways before I updated Connect to 1.4.5 from 1.4.1.
For now you can do (in your nested config):
app.use(express.static(require('path').resolve(__dirname + "/../../public")));
Thanks, guille. Worked like a charm.
Was this a 4am fix TJ?
my sleeping skills are amazing, among the best, perhaps even better than mercedes
TJ, why don't you tell us more about that rm -rf pull request...