express-resource
express-resource copied to clipboard
express-resource will support express4?
Hi,
looks handy express-resource, will it support express 4 too? thanks,
A.C.
+1. I want to ask this question as well.
For what it's worth, I've written a similar module for Express 4.x: https://github.com/olalonde/resourcemap
Seems to work here! :+1:
Thanks @ milanvanschaik . I will start using it and I hope this project is still going!
ditto on the express 4. The nested routes are broken as they're using express3's app.routes, which no longer exists. It crashes on that line: https://github.com/expressjs/express-resource/blob/master/index.js#L197
+1 need this badly... is anyone working on this anymore?
@TylerBrock FWIW, I haven't felt the need to use express-resource anymore with the new Router functionality. It's quite easy to setup resource like routes. For example:
function router() {
return new express.Router({
mergeParams: true, // inherit parent router's params
});
}
var logsRouter = router()
.get('/', logs.index);
var txsRouter = router()
.use(bodyParser.json())
.get('/:txID', txs.show)
.get('/:txID/logs', logsRouter)
.post('/', txs.create);
app.use('/txs', txsRouter)
Thank you! It definitely is much easier to do now but it would still be nice to have loaders (you can probably accomplish this with middleware though.