Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koa Mini

使用 40 行代码实现一个最简化版本的 Koa

Example

测试用例如下:

// Example
const app = new Application()

app.use(async (ctx, next) => {
  console.log('Middleware 1 Start')
  await next()
  console.log('Middleware 1 End')
})

app.use(async (ctx, next) => {
  console.log('Middleware 2 Start')
  await next()
  console.log('Middleware 2 End')
})

app.listen(7000)

// console.log
// Middleware 1 Start
// Middleware 2 Start
// Middleware 2 End
// Middleware 1 End

About

使用不到40行代码实现一个 koa,使用四十行代码实现一个核心 koa

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages