Thursday, 14 November 2019

Should you always have a controller?

https://github.com/MoathShreim/Nodejs-rest-api-project-structure-Express/blob/master/controllers/baseController.jsI like the idea of creating a base controller, but my routes all implement complex business code that are rarely reused. So I implemented a service layer for each of them. Should I still use controllers? Can you use controllers for handling something else than the response and db calls? What are some of the different approaches of using controllers in a Node.js Express application?

Submitted November 15, 2019 at 03:49AM by jesusscript

No comments:

Post a Comment