I have been following this tutorial which incorporates using the Jade template engine and Stylus css processor to achieve cleaner html syntax and compiled css.
Most of the tutorial was straight forward, with a few tailored differences:
I have all my logic in server.js (rather than app.js).
I mimic'd the boilerplate directory structure available in this demo, which made it clear I will need to refactor.
It took me some time to understand why my index.jade file was returning an Error: Not Found. I referenced this stackoverflow to set my views to the right subdirectory. It's annoying the error message is not more helpful.
app.set('views', __dirname + '/app/views/layouts');
With this change, I was finally getting the page returned, but the stylesheet was returning a 404 with a similar Not Found stack that referenced a "stylesheets" directory I had not created. I found this stackoverflow which suggested placing the .styl file in the public/stylesheets directory.
app.use('public/javascripts',express.static(path.join(__dirname, 'public/javascripts'))); app.use('public/stylesheets',express.static(path.join(__dirname, 'public/stylesheets')));
Now, I have a front end... onward!

















