写一个node服务
const Koa = require('koa')
const app = new Koa()
class SetMap extends Map {
}
const myMap = new SetMap()
let id = 0
app.use(async (ctx, next) => {
ctx.id = id++
myMap.set(id, ctx)
await next()
});
app.use(async ctx => {
console.log(ctx.id)
ctx.body = 'Hello World' + ctx.id;
});
app.listen(3004);
安装Apache的ab
ab:下载windows版
解压后复制bin目录到环境变量path