Re:Why we moved from NodeJS to Ruby on Rails
by doomslice on Tuesday May 15, 2012 @09:51AM
(#3976521)
Express doesn't even have controllers though -- just a routing mechanism.
If you set up your controllers so that they are independent from the routes, then they are just as easy to test.
It could be as simple as: app.get('/users/:id', userController.userPage). You can then test userController.userPage(req, res, next) instead of the route.
If you set up your controllers so that they are independent from the routes, then they are just as easy to test.
It could be as simple as: app.get('/users/:id', userController.userPage). You can then test userController.userPage(req, res, next) instead of the route.