Skip to content

gotoin/koa-api

Repository files navigation

Koa2 RESTful

基于 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/

注册

http://127.0.0.1:3001/register?loginName=test&password=123456

登录

http://127.0.0.1:3001/login?loginName=test&password=123456

Releases

No releases published

Packages

No packages published