# koa2-example **Repository Path**: mlyknown/koa2-example ## Basic Information - **Project Name**: koa2-example - **Description**: koa2学习代码 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-06-06 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README #学习koa2的demo ## 一、全局环境依赖 npm install -g nodemon --- ## 二、快速开始 1. npm install 2. 启动 * node start.js * nodemon start.js --- ## 三、插件介绍 1. Generator中间件转async中间件 * koa-convert 2. 跨域请求 * koa-cors [github地址](https://github.com/evert0n/koa-cors) * 需要用koa-convert转化 --- ## 四、API介绍 * /api/get => 返回json数据 * /api/post =>接受表单数据 * /api/static =>发送静态资源 * / => 返回首页 * /home => 返回首页 * /fileUpload => 返回上传文件页面 * /filesUpload =>返回上传多文件页面 * /util --- ## 五、其他模块介绍 * shell-task 编写shell命令 ---