the one key thing you have to remember (currently), is that all of the
routes (app.get, app.put, etc)
are part of a routing middleware called app.router (this is an
instance of a Router). So app.use()
works with individual middleware, so if you call it between two
app.get() calls for example it's
not actually added between them.
so you might want to do something like:
app.use(loadViewData);
app.use(app.router);
app.get('/.....
that way it's before the routes.
I should note that I've played with each app.{get,put,...}() call
being its
own middleware, which is nice in a lot of ways but I need to improve
the
performance of that solution before considering it