Koa API Startup Kit
My personal Koa2 API startup kit, feel free to use and contribute if you like.
Setup Development Environment
Create Config Files
.env file based on the
cp .env.example .env
Check and replace the environment variables in the new file.
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.
The server will be available in the port you set in the
# 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
- Docker compose infrastructure
- CI/CD Jenkinks
- Production environment