Giter Site home page Giter Site logo

pet-shop-api's Introduction

Pet Shop API

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.

Features

  • 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

Tools Used

  • Uses the Node package SheetJS from npm to extract pet data from the spreadsheet named "data.xlsx" in the local directory.

Working

  • The Excel file has colums Name, Type, Breed and Age.
    Excel File
  • 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.
    Postman Snip

Setting up on localhost

  • 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 then code . 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.

pet-shop-api's People

Contributors

saket-dev01 avatar vaish0903 avatar

Watchers

 avatar

Forkers

vaish0903

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.