2 ms·
Usually with Node.js/Express we handle stuff like authentication on middleware, so controllers don't need to bother. The route just includes the authentication/
by bergie 15y ago
Usually with Node.js/Express we handle stuff like authentication on middleware, so controllers don't need to bother. The route just includes the authentication/authorization middleware if one is needed.
Here is a simple example for hooking in route-specific middlewares:
https://gist.github.com/978411#file_express_middlewares.coffee https://gist.github.com/978411#file_express_middlewares.coff...