koa test1 创建项目

安装

npm install koa -g

导入

const koa = reuqiet('koa');

const app = koa();

中间件

app.use(async ctx=>{

   ctx.body = 'holle world' 

});

async :创建异步操作

ctx : 创建上下文

ctx.body :返回信息

监听

app.listen(3000)

猜你喜欢

转载自blog.csdn.net/chao2458/article/details/85098777