Trial for Xendit
- Node.js with express using typescript
- Supertest/Jest for unit testing
- Yarn
- Docker
- Docker-compose
- copy
.env.dist
to.env
$ cp .env.dist .env
- install all dependencies
$ yarn install
- build docker containers
$ docker-compose up -d --build
-
migrate PostgreSQL data
verify node docker (
xendit-trial_node_xendit_1
) container is running, verify by runningdocker ps -a
$ docker ps -a CONTAINER ID IMAGE PORTS NAMES 88d7c9ab3dfb xendit_node_xendit xendit-trial_node_xendit_1 421078ab7b46 postgres:11.6 0.0.0.0:5432->5432/tcp xendit-trial_postgres_1 4ac02d653a37 nginx:1.17-alpine 0.0.0.0:3800->80/tcp xendit-trial_nginx_1
execute migration script using docker exec
$ docker exec xendit-trial_node_xendit_1 yarn migrate up
replace <docker_node_name> if docker name is changed or different.
$ docker exec <docker_node_name> yarn migrate up
-
You can now access the application at http://localhost:3800
METHOD | Route |
---|---|
POST | http://localhost:3800/notifications/<merchantId>/notify/test |
POST | http://localhost:3800/notifications/<merchantId>/notify |
POST | http://localhost:3800/notifications/<notificationId>/retry |
GET | http://localhost:3800/merchants |
PATCH | http://localhost:3800/merchants/<merchantId> |
Access docs at http://localhost:3800/api-docs
$ docker exec xendit-trial_node_xendit_1 yarn test
or replace <docker_node_name> if docker name is different.
$ docker exec <xendit_node_service_name> yarn test