This is a RESTful API that takes an excel file as input, parses it and stores the data in the database. It uses NodeJs, Express and MongoDB.
- A POST route “/api/pet” to add pets from an excel file to the Database
- A GET route “/api/pet” to get all the pets in the Database
- A GET route “/api/pet/petId” to get a specific pet
- A PATCH route “/api/pet/petId” to update the details of a specific pet
- A DELETE route “/api/pet/petId” to delete a specific pet
- Uses the Node package SheetJS from npm to extract pet data from the spreadsheet named "data.xlsx" in the local directory.
- The Excel file has colums Name, Type, Breed and Age.
- Node Package SheetJS takes the excel file and parses it, and adds it to the Database upon sending a POST Request to
http://localhost:3000/api/pet
. - Upon sending a GET request to
http://localhost:3000/api/pet
, we get a JSON response containing all the pets in the Database.
- Install and set up NodeJS.
- Set up MongoDB.
- Type
git clone https://github.com/areyaar/Pet-Shop-API.git
on your git bash terminal and thencode .
to open the project on your favorite code editor. - Type
npm install
in the terminal to install all the node packages and dependencies. - Type
node app.js
to have the API running on the port 3000 of your localhost.