搜索 Detour

开始输入即可搜索全部文章。

Koa.js

概念

中间件 middleware

app.use(async (ctx, next) => {
  
  // ctx, context, 上下文
  
  console.log(`${ctx.method} ${ctx.url} ${new Date()}`);
  
  // next, promise,下一步
  
  return await next();
  
});
  

调试

VSCode

VS Code 侧边栏的“调试”,在代码中设置断点。

Chrome

node --inspect server.js
  
  1. chrome 打开 chrome://inspect
  2. Remote Target 选择对应的页面
  3. Source - add folder to workspace,在 server.js 中添加断点

附录

标签

接着看

技术2020

Mac使用记录

数据科学之路

技术

数据科学之路

技术2020

NumPy

技术2020

Notes on TypeScript

技术2020

我在大厂如何打怪升级

技术2020

Server's Cookbook

分享这篇文章