Skip to content
master
Switch branches/tags
Code

Koa API Startup Kit

My personal Koa2 API startup kit, feel free to use and contribute if you like.

Prerequisites

Setup Development Environment

Create Config Files

Create an .env file based on the .env.example

  cp .env.example .env

Check and replace the environment variables in the new file.

Initialize Database

Here you can either choose to have and instance of Postgres installed locally in your machine or use a docker container.

Simple example of using Postgres through Docker:

  docker run -it -p 5432:5432 -e POSTGRES_USER='root' -e POSTGRES_PASSWORD='password' -e POSTGRES_DB='db_koa' postgres:10

Keep in mind that sample above don't generate a volume, so it wont persist the data after you stop your docker container.

Install dependencies

  yarn install

Migrate database

  yarn migrate

Starting App

  yarn dev

The server will be available in the port you set in the .env file

Tests

# Unit
yarn test

# Integration
yarn test:i

# Acceptance
yarn test:a

# All (Sequential)
yarn test:all

You need a database running with all migrations for the integration and acceptance tests

Todos

  • Docker compose infrastructure
  • CI/CD Jenkinks
  • Production environment

License

MIT

About

My personal Koa2 API startup kit, feel free to use and contribute if you like

Topics

Resources

Releases

No releases published

Packages

No packages published