npm i koa-generator -g
koa2 projectName
cd projectName && yarn
koa跨域(koa2-cros模块): https://www.npmjs.com/package/koa2-cors
var cors = require('koa-cors');
var app = koa();
app.use(cors());
mongodb (mongoose模块)
const crypto = require('crypto');
//md5加密
let createMd5 = str =>{
let hash = crypto.createHash('md5');
return hash.update(str).digest('hex');
}
console.log(createMd5(456))
时间(moment模块)http://momentjs.cn/docs/