Closed sohilpandya closed 6 years ago
I agree with them both - didn't know you could do the second point that way, thanks. I would be more inclined to combine the two in controller/index.js
as we expect to see all our endpoints in this file - what do you think @polyccon ?
I also agree with both points and also agree with choosing controllers/index.js
:+1:
I am slightly confused by the flow that we have for routes in the app. I'll take the example of
home
.app.js
we use/home
route and run therequireLogin
function which will either grant/deny access to the given page./
so they know they have been denied access and are redirected to homepage or login page.home.js
file. Can we not combine the two either in theapp.js
orcontroller/index.js
so that we have all the information for a given route in one place?router.get(
/home, requireLogin, home.get)
What are your thoughts on these two points?