🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# route app.js ~~~ var routes = require('./routes/index'); var users = require('./routes/users'); ~~~ 挂载路由 ~~~ app.use('/', routes); app.use('/users', users); ~~~ ## 具体写法 ~~~ var express = require('express'); var router = express.Router(); /* GET home page. */ router.get('/', function(req, res, next) { res.render('index', { title: 'Express' }); }); module.exports = router; ~~~ * get * post * patch * delete * all 更多见http里的verb章节