1.安装依赖
cnpm init -y cnpm i nodemon puppeteer -S cnpm i koa koa-router koa2-cors -S
如果已经存在node_module的包文件,使用以下两条命令
cnpm init -y cnpm install
2.配置pack.json文件
"scripts": {"start": "nodemon index.js"},
3.项目结构目录
3.1在config文件中
3.2 在router路由文件中
3.3 在主文件index.js(app.js)中
4.启动项目
nodemon (入口文件index.js)we 或者 npm start(在pack.json中已经配置了)
