koa中文网Koa(koa.js)中文网 -- 基于 Node.js 平台的下一代 web 开发框架
koa实例:
- npm init -y一个json文件
- npm install -s koa 安装koa依赖
- 创建index.js入口文件,此时目录结构:
- index.js中引入 koa进行简单应用,在终端输入node index.js 运行
const koa = require('koa') const app = new koa() app.use(async ctx => { ctx.body = "hello world" }) app.listen(