user.js contains routing rules, which can be seen from the following code of app.js. user.js and index.js are both routing rules, so they look similar.
var routes = require('./routes/index');
var users = require('./routes/users');
app.use('/', routes);
app.use('/users', users);
Here are the study notes of express. Of course, I recommend the official documentation.
user.js
contains routing rules, which can be seen from the following code ofapp.js
.user.js
andindex.js
are both routing rules, so they look similar.Here are the study notes of express. Of course, I recommend the official documentation.