app.js
const routes = require('./config/routes');
// 路由
app.use(routes);
config/routes.js
const express = require('express');
const router = express.Router();
// 路由中间件
const adminAuth = require('../middlewares/admin-auth');
const userAuth = require('../middlewares/user-auth');
// 前台路由文件
const indexRouter = require('../routes');
const categoriesRouter = require('../routes/categories');
const coursesRouter = require('../routes/courses');
const chapter...