app.use(async (ctx, next) => {
// ctx, context, 上下文
console.log(`${ctx.method} ${ctx.url} ${new Date()}`);
// next, promise,下一步
return await next();
});
VS Code 侧边栏的“调试”,在代码中设置断点。
node --inspect server.js
chrome://inspect
server.js
中添加断点