1var express = require('express');
2
3var router = express.Router();
4
5router.get('/', function(req, res) {
6 res.send('GET handler for /dogs route.');
7});
8
9router.post('/', function(req, res) {
10 res.send('POST handler for /dogs route.');
11});
12
13module.exports = router;
14
1var express = require('express'),
2 dogs = require('./routes/dogs'),
3 cats = require('./routes/cats'),
4 birds = require('./routes/birds');
5
6var app = express();
7
8app.use('/dogs', dogs);
9app.use('/cats', cats);
10app.use('/birds', birds);
11
12app.listen(3000);
13