has tested blocking routes, and setting cross-domain has the same effect:
index.js:
router.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE");
res.header("Access-Control-Allow-Headers", "Content-Type");
const url=req.url
if (url.indexOf("test")!=-1){
return res.json("test")
}
next();
});
...
router.all("*",function(req, res, next) {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Methods", "GET,PUT,POST,DELETE");
res.header("Access-Control-Allow-Headers", "Content-Type");
const url=req.url
if (url.indexOf("test")!=-1){
return res.json("test")
}
next();
});
...
what"s the difference between local testing and which one should be used?