Answer the question
In order to leave comments, you need to log in
What functions is the controller responsible for in MVC on express?
What is the controller in express responsible for with its middleware chain? I have several options in my head:
1) Only for routing. Accepts urls and redirects all responsibility to another module.
//controller.js
router.get('/', business.indexPageMiddlewareList)
//controller.js
const indexPage = [loggermiddleware, ...., business.getpage]
//controller.js
router.get('/', logger_middleware, auth_middleware, business.indexPage)
//controller.js
const get_data = (req, res, next) => {}....
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question