Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shappy0/twf_test
https://github.com/shappy0/twf_test
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/shappy0/twf_test
- Owner: SHAPPY0
- Created: 2019-06-28T13:17:13.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:37:18.000Z (about 2 years ago)
- Last Synced: 2023-10-11T10:19:12.203Z (about 1 year ago)
- Language: JavaScript
- Size: 22.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Intro
Before run this app please read this carefully.I used ``` Node.js ``` to create the server and ``` Express.js``` as framework to create the api.
**API**: ``` http://localhost:3000/api/getcost ```
**Method**: ```POST```
**Request Format**:
```
[{
"product":"A",
"quantity":1
}]
```**If multiple orders**:
```
[{
"product":"A",
"quantity":1
},{
"product":"B",
"quantity":2
}]
```**OUTPUT Format**:
```
{
"success": true,
"minimum_cost": 44
}
```## How to run app
1. Download the source code from this github link and unzip.
2. After unzip folder open terminal.
3. Change Directory to the root of this source code in terminal.
4. Run `npm install` to download required dependecies.
5. Now run `node app.js` to start Node server.
6. Now you can test the above given api with given request format in postman.## NOTE
In this api I just considered some part as static because its a demo test, i.e center's indexing and products details.