📜  express() 和 express.router() 之间的区别 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:16.378000             🧑  作者: Mango

代码示例2
var express = require('express'),
    dogs    = require('./routes/dogs'),
    cats    = require('./routes/cats'),
    birds   = require('./routes/birds');

var app = express();

app.use('/dogs',  dogs);
app.use('/cats',  cats);
app.use('/birds', birds);

app.listen(3000);