Skip to content
/ koa-starter Public template

A Koa starter template with sequelize, pm2 and http2 ready.

Notifications You must be signed in to change notification settings

knowlet/koa-starter

Repository files navigation

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

About

A Koa starter template with sequelize, pm2 and http2 ready.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published