Locally, my node.js with express app works as expected. When I push to Heroku, the app is able to load some stylesheets and javascripts, but not others. Here is the relevant snippet from app.js:
app.configure(function(){
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(app.router);
app.use(express.static(__dirname + '/public'));
});
Here are the assets that I'm loading from my jade templates:
link(href='/stylesheets/style.css', rel='stylesheet')
link(href='/lib/bootstrap/docs/assets/css/bootstrap.css', rel='stylesheet')
link(href='/lib/bootstrap/docs/assets/css/bootstrap-responsive.css', rel='stylesheet')
script(src='/lib/jquery/jquery-1.7.2.js')
script(src='/lib/bootstrap/docs/assets/js/bootstrap-collapse.js')
Everything works locally, but when I push to Heroku, the style.css
file and the jquery file are loaded fine. The bootstrap files return a 404.
I'm baffled why this would work locally but would break, and in parts, on Heroku.