routes.js
var router = require('express').Router();
router.get('/all', require('./all'));
module.exports = router;
all.js work
module.exports = function(req, res, next) {
res.send('this one work');
};
all.js not work.
const start = function(req, res, next) {
res.write('start');
next();
}
const finish = function(req, res, next){
res.write('finish!');
res.end();
}
module.exports = function(req, res, next) {
start,
finish
};
How to make the all.js to work. Update: complete code of the page