This code return "var2 is not defined", how can I use the var2 in router.get('/').. sentence?
Thanks in advance
`//router
var express = require('express');
var router = express.Router();
router.use('/', function(req, res, next){
var2: "That is a var 2";
next();
});
router.get('/', function(req, res, next){
res.send(var2);
});
module.exports = router;`
Aucun commentaire:
Enregistrer un commentaire