showing results for - "difference between express 28 29 and express router 28 29"
Barclay
13 Oct 2017
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
Lucia
07 Jun 2017
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
similar questions