Skip to content

maheshinder19/twfApi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twfApi Documentation

The api is running at : https://twfapi.herokuapp.com/

Format of input

In order to get the result from the api, one need to make a POST request to https://twfapi.herokuapp.com/order. The format of the request body will be a json object with an array named order that has details of the products ordered. For example, if an order consists of a "A" product, 2 "D" products and 2 "G" products. So request body will look like:

{
	"order" :	[ 
		  { "name": "A", "qty": 1, "weight": 3 },
		  { "name": "D", "qty": 2, "weight": 12 },
		  { "name": "G", "qty": 2, "weight": 0.5 }]
}

(give weights in number of kg)

Example

I have used postman to make a POST request to the api.

postman

The response is as follows:

enter image description here

To run on local machine

  • In order to run the code on local machine, clone the repo, install the dependencies and run npm start in the root directory of the repo.

  • The api will take requests on localhost:3000.

  • Make a POST request to localhost:3000/order to get the result in the above explained format.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published