express_code_structure icon indicating copy to clipboard operation
express_code_structure copied to clipboard

Clarifying question

Open zink38 opened this issue 1 year ago • 0 comments

The routes are plugged in on index.js, but they allude to an MVC design with a common ./routes directory. For this example should they be require(./feature/router.js ?

// Load the routes
app.use(require('./routes/site'));
app.use('/api/jobs', require('./routes/customers'));
app.use('/api/users', require('./routes/users'));

// FINALLY, use any error handlers
app.use(require('./routes/errors/not-found'));

Also I having trouble understanding the ./site directory. if user.pug is in the in the user feature should home.pug be in a home directory ? or is ./site more of a place for static html. What if app is doing a lot of backend operations on the home page

Thank you so much for teaching so many principles in a sea of tutorials that don't address their design pattern choices, leaving tons of new developers unsure what is best practice , what is essential, and what is simply preference or monkey-see monkey-do.

zink38 avatar Dec 19 '24 01:12 zink38