Skip to content
Snippets Groups Projects
Commit 1d3df700 authored by Stefan Pandzic's avatar Stefan Pandzic
Browse files

Add README.md

parent e5d5fda7
Branches
No related merge requests found
# Customer-management-API by Stefan Pandzic
-Steps to run application
1) Clone project from GitLab.
2) Open terminal and type `npm install`.
3) Make new file in root directory of project and name it `.env`.
4) You need to ask me to give you password for connection to Mongo DB database.
5) You need to write that password in env file what you just created.
6) then type `npm start`.
If you get message on terminal `Connected to MongoDB` that mean your application is running.
-Now you need to import postman collection with API routes.
You have file named `CustomerApi.postman_collection.json` in root directory of project,
import that to your postman application and you will get all endpoints what you need.
If that not work, you can make your own endpoints.
1) Api Endpoint for CREATE CUSTOMER `POST METHOD "http://localhost:5000/managment_api/customer/"`
and add body in json format with object,
`{
"name": "customer name",
"email": "customer email",
"contactNumber":"contact number"
}`
2) Api Endpoint for GET ALL CUSTOMERS `GET METHOD "http://localhost:5000/managment_api/customer/"`
3) Api Endpoint for GET CUSTOMER BY ID `GET METHOD "http://localhost:5000/managment_api/customer/:customerId"` where you need change :customerId with actual id.
4) Api Endpoint for DELETE CUSTOMER BY ID `DELETE METHOD "http://localhost:5000/managment_api/customer/:customerId"` where you need change :customerId with actual id.
5) Api Endpoint for UPDATE CUSTOMER BY ID `PATCH METHOD "http://localhost:5000/managment_api/customer/:customerId"` where you need change :customerId with actual id and
add Body in json format with fields you want to update.
example: {
"name": "Chris"
}`
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment