Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarifying question #34

Open
zink38 opened this issue Dec 19, 2024 · 0 comments
Open

Clarifying question #34

zink38 opened this issue Dec 19, 2024 · 0 comments

Comments

@zink38
Copy link

zink38 commented Dec 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant