dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

How to use it in express 4.x? #641

Open TylerYang opened 9 years ago

TylerYang commented 9 years ago

Hi guys, just look through the document. Seems to use orm in express.js, we need to write the code like app.use(orm.express(...)); And we need to make sure put it before app.use(app.router).

However app.router is deprecated after express4.x . Is there a way to use it as middleware in express 4.x ? Thx.

dxg commented 9 years ago

Should be enough to put it before all your routes like:

app.get('/blah', function (...) { ... });