mdmuhtasimfuadfahim / coindesk-test-api

Home Page:coindesk-test-api.vercel.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CoinDesk Test API Documentation

General Information

This is a simple API by which will set the currency code(USD, EUR, BDT) as a parameter in the request query and in return user will get the following information in response:

  • The current Bitcoin rate, in the requested currency.
  • The lowest Bitcoin rate and date in the last 30 days, in the requested currency.
  • The highest Bitcoin rate and date in the last 30 days, in the requested currency.

Tools and Technologies:

  • Node.js
  • NPM (it is automatically installed with node) / Yarn

Getting Started

To create the API (/getBitcoinInfo), you need to set environment for Nodejs, and you must follow the steps below:

Step 1: Clone this repo by:
git clone https://github.com/mdmuhtasimfuadfahim/coindesk-test-api

Step 2: Change PORT according to your preference or leave it as it is.

Step 3: From the root directory, run the commands:
yarn install
yarn serve

The API will start and you can send request and get response.

Note: Please use yarn add dependency_name or npm install dependency_name if something went wrong with yarn install.

Unit Test

From the root directory run the commad:
yarn test

Note: Please use the line: const getCurrencyCode = req.body.currency; in app.js file if you want to give request body using the API.

Thank you

About

coindesk-test-api.vercel.app


Languages

Language:JavaScript 99.7%Language:Shell 0.3%