🚧 This project is still a work in progress 🚧
$ npm install
# development
$ npm run start:dev
# production mode
$ npm run start:prod
- edit
/etc/hosts
file and then add127.0.0.1 api.whoowesme.local
$ cp .env.example .env
- Open
.env
and configure to suit your need
$ docker network create web
$ docker volume create whodata
Project contains end-to-end testings only so you will not find any unit test.
Environment variables are loaded from .env.test
env file. During e2e test, database "db_whoowesmetest" is used.
.env.test
contains exactly the same content as that of .env
. Create .env.test
from .env.example
at project root directory.
docker-compose up -d
will create whodbtest
container used for e2e test.
# Filename: .env.test
FRONTEND_ORIGIN=http://localhost:8000
APP_PORT=5000
POSTGRES_HOST=127.0.0.1
POSTGRES_PORT=5423
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
POSTGRES_DATABASE=db_whoowesmetest
DB_SYNCHRONIZE=false
JWT_SECRETS=SecrestForTest
JWT_TOKEN_EXPIRES=2h
# e2e tests without coverage
$ npm run test:e2e
# e2e tests with coverage
$ npm run test:e2e:cov
- visit
http://api.whoowesme.local
you should see output as{"status":"OK","version":"1.0.0"}
. If you see this output then it means api is configured properly.
if you get service unavailable
then it means something is not configured properly then you should check the output log of docker logs whoapi
and then fix accordingly.
## Up Migration, Get inside docker then run migration script
$ docker exec -it whoapi sh
$ npm run migration:up
## Down Migration, get inside docker then run below command
$ npm run migration:down
- MIT