Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tengocharlie/alphonic-interview-task
Jaipur based company fro MERN stack
https://github.com/tengocharlie/alphonic-interview-task
Last synced: about 1 month ago
JSON representation
Jaipur based company fro MERN stack
- Host: GitHub
- URL: https://github.com/tengocharlie/alphonic-interview-task
- Owner: TengoCharlie
- Created: 2021-05-26T12:39:55.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-27T09:01:22.000Z (over 3 years ago)
- Last Synced: 2023-03-05T21:18:05.282Z (almost 2 years ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API link [http://productapi.tenguriya.com/](http://productapi.tenguriya.com/)
## API documentation for Front End Developers [DOCS](https://documenter.getpostman.com/view/15198037/TzXxix8D)# Alphonic-interview-task
### You have to create a Node ExpressJS API and test it using the Postman tool.
#### This app will have MongoDB connect and all the products will be saved in the "myDb" database.
1. `[POST] /api/v1/addProduct`
Fields:1. Name
2. Price
3. Description2. `[GET] /api/v1/getProduct?id=`
3. `[GET] /api/v1/getProducts`
this is will return all products4. `[POST] /api/v1/updateProduct`
Fields:
1. Name
2. Price
3. Description
4. `\_id`You need to create the POSTMAN collection so that it can be published for the front-end developers
# Solution
- `[POST] /api/v1/addProduct` = For adding data to collection.
- `[GET] /api/v1/getProduct?id=` = For getting data for a particular id by using id as a query in URL.
- `[GET] /api/v1/getProducts` = For Getting all the data in the collection.
- `[POST] /api/v1/updateProduct/:id` = For updating data in collection , you have to pass `ObjectId` as a parameter.## For run it on Development server
- Run `npm install` - to install all the dependencies
- Then Run `npm run dev`### it will run on PORT 3000
### it uses local MongoDB server for Database
## For run it on Production server
- Run `npm install` - to install all the dependencies
- Then Run `npm start`#### you have to change `MONGO_URL` and `PORT` in _.env_ file