Giter Site home page Giter Site logo

xendit-trial's Introduction

Xendit API

Trial for Xendit

Specifications

  • Node.js with express using typescript
  • Supertest/Jest for unit testing

Requirements

  • Yarn
  • Docker
  • Docker-compose

Installation

  1. copy .env.dist to .env
$ cp .env.dist .env
  1. install all dependencies
$ yarn install
  1. build docker containers
$ docker-compose up -d --build
  1. migrate PostgreSQL data

    verify node docker (xendit-trial_node_xendit_1) container is running, verify by running docker 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
  2. You can now access the application at http://localhost:3800


API Routes

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>

Swagger Docs

Access docs at http://localhost:3800/api-docs


Running Test

$ 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.