Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.29 KB

README.md

File metadata and controls

55 lines (35 loc) · 1.29 KB

JavaScript Style Guide .github/workflows/node.js.yml CodeQL

koa-starter

A sample and http2 ready koa2 starter template.

Requirement

  • node: 7.6 or higher

Development

The devServer mode will create controller when you add routing file in routes folder.

npm run dev

or use the pm2 watch mode (but won't create controller automatically).

npm run dev-pm2

Testing

npm test

Production

npm start

DB Migration

Starting a db

You can start a db by using docker

docker run --name koadb -p 3306:3306 --restart=always -e MYSQL_RANDOM_ROOT_PASSWORD=true -d mariadb:latest --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
docker logs koadb 2>&1 | grep "GENERATED ROOT PASSWORD" | awk '{print $4}'

Create databases

node_modules/.bin/sequelize db:create --config src/models/config.json