搜索文章

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

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 中添加断点

附录

接着看

  1. Mac使用记录技术
  2. 数据科学之路技术
  3. NumPy技术
  4. Notes on TypeScript技术
  5. 我在大厂如何打怪升级技术
  6. Server's Cookbook技术