Note: Before run this app please make sure MongoDB server is running.
- Clone this repo and then open CMD and change directory to root folder and run
'npm install'
to download dependencies.
- run
'node index.js'
to start the node server
- after start server open postman or any other rest api test tool
- To read and save data in mongodb use below api
URL: http://localhost:8080/api/readCsv
METHOD: GET
- User Registration
URL: http://localhost:8080/api/user/register
METHOD: POST
REQUEST:
{
"userid":"test",
"password":"test"
}
- User login
URL: http://localhost:8080/api/user/login
METHOD: POST
REQUEST:{
"userid":"test",
"password":"test"
}
- Fetch Records based on paginations
URL: http://localhost:8080/api/fetchRows/:skip/:limit
METHOD:GET
REQUEST HEADERS:{
authorization: "Bearer <Paste authorization token which you got after login>"
}
- Fetch records with filters
URL : http://localhost:8080/api/fetchRows/:skip/:limit?country=:country&®ion=:region
METHOD:GET
REQUEST HEADERS:{
authorization: "Bearer <Authorization token which you got after login>"
}