基于 koa2 开发的脚手架,支持es7语法。
- koa2 - Expressive middleware for node.js using ES2017 async functions.
- koa-router - Router middleware for koa.
- koa-jwt - Koa middleware for validating JSON Web Tokens.
- koa-body - koa body parser middleware.
- koa-unless - Conditionally add a middleware to koa with some common patterns.
- jsonwebtoken - JsonWebToken implementation for node.js.
- koa-logger - Development style logging middleware.
- sequelize - An easy-to-use multi SQL dialect ORM for Node.js.
- mysql2 - fast node-mysql compatible mysql driver for node.js.
- eslint - A fully pluggable tool for identifying and reporting on patterns in JavaScript.
- nodemon - Monitor for any changes in your node.js application and automatically restart the server - perfect for development.
- pm2 - Node.js Production Process Manager with a built-in Load Balancer.
- lodash - A modern JavaScript utility library delivering modularity, performance, & extras.
- babel - Babel is a compiler for writing next generation JavaScript.
$ git clone https://github.com/gotoin/koa-api.git
$ cd koa-api
$ npm install
//or yarn install
修改数据库 config/env/development.js
# 数据库迁移
$ npm run sequelize db:migrate
# 本地开发
$ npm run start
# 部署
$ npm run pm2
http://127.0.0.1:3001/register?loginName=test&password=123456