node路由访问,中间件返回数据 定义一个变量存放json数据,中间件接受数据 var responseData; router.use(function(req, res, next) { responseData = { code: , message: '' }; next(); }); 访问路由,返回相应的数据 router.get('/', function(req, res, next) { responseData.code = ; responseData.message = '