koa 学习1
1.搭建環境;
npm init -f
2.出現錯誤
npm ERR!Windows_NT 6.1.7601 解決方法: npm config set proxy null npm install cnpm -g --registry=https://registry.npm.taobao.org 3.安裝koa cnpm i koa 4.下載node.exe 7.6.0 版本; https://npm.taobao.org/mirrors/node/v7.6.0/win-x64/ 5.形成app.js const Koa = require('koa'); const app = new Koa();app.use(async ctx => { ctx.body = 'Hello World, New Demo'; });
app.listen(3001);
?
?
轉載于:https://www.cnblogs.com/maomingchao/p/koa.html
總結
- 上一篇: ntp服务器同步时间详细配置
- 下一篇: 七、函数