Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 538 Bytes

2010-04-16-express-js-gotcha.md

File metadata and controls

11 lines (9 loc) · 538 Bytes

Less of a wtf and more of a gotcha. In ExpressJS. you can serve static files from a /public directory with this simple directive in your configure block:

configure(function() { set("root", __dirname); // allow static file serving from public directory use(Static); });

But be careful! This sets a the path to be /public/app.css rather than /app.css. More background here.