i just started playing with node.js and so far it seems pretty intriguing. my first use case for node.js is to make some JSON APIs. trying to figure out what the structure of a node.js project should be has been a pretty frustrating experience, though.
nevermind that node.js is still in its infancy and the core APIs have been changing at an alarming rate.
nevermind that this means that many blogs that you read about node.js examples won’t work anymore because they were for an older version of node.
what is the most frustrating thing in the world is that trying to figure out what best practice is seems impossible to verify because everyone is still trying to figure out what best practice really is.
that being said, i’ve decided to use express as the web framework. it seems pretty popular, lightweight, and relatively straightforward to use.
a convenience layer is consolidate which will make swapping template engines relatively painless, though in practice, i don’t know how realistic this is because even though you can swap out a template engine, the views probably won’t be syntactically compatible. still, using consolidate did make setting up dustjs relatively straightforward.
that being said, IF you use consolidate and you want to use dustjs-helpers, there’s really no good documentation on how to do it. the best hint i found was actually in the git repo for dustjs.
1 2 3 4
app.engine('dust', cons.dust); cons.dust.helpers = require('dustjs-helpers'); app.set('view engine', 'dust'); app.set('views', __dirname + '/views');