440010
使用的是express 框架
express 的路由如下
myRouter.js
router.get("/",(req,res)=>{ let stop = require("stop.js"); stop(res); // 在这里就终止了本次执行请求
res.end("结束了"); // 这里不会被调用 })
==================分割线=============================== stop.js
module.export = (res)=>{
}
========================分割线==================================
我希望的结果是 在stop函数中执行完后,直接就终止了本次执行, 无需添加任何代码来终止。 请问如何写stop.js 中的代码??????