Git Product home page Git Product logo

donutsapi's Introduction

Donut API Project

This is a project that will provide you with a Donut API. When you build this project it will fetch the latest and most up-to-date info about donuts being sold on Krispy Kreme's website. It will include names, descriptions, images, image alt text, banners and nutritional facts for your donuts.

If there are any issues with this API, please submit an issue on the repo. Or (BETTER) submit a Pull Request to address the issue.

There are two scripts in this package:

  • npm run build
    • This builds the API out by scraping the Krispy Kreme website for all current donuts and types. As donuts are seasonal, you will want to run this every so often to update the donuts.json in your project folder.
    • Because I saved the data files to the source, YOU ONLY NEED TO RUN THIS TO GET THE LATEST INFO.
    • If you do this, it may not work anymore. And you will to just do a git reset and only run the serve command.
  • npm run serve
    • This runs a server to serve your data on localhost:3000.

APIS

The following APIs are available AFTER you run npm run build:

  • /donuts - Returns all donuts from the API
  • /donuts/:donutId - Returns a donut from the API
  • /types - Returns all donut types from the API

/donuts

This API will return all of the donuts that were scraped from the Krispy Kreme website during the build of the API. You can add one query param to this API: type. This allows you to do an inclusive filter of types:

GET /donuts // Return all donuts
GET /donuts?type=Iced // Return donuts with the type of "Iced"
GET /donuts?type=Iced,Filled // Return donuts with the types "Iced" OR "Filled"

/donuts/:donutId

This API will return one donut that was scraped from the Krispy Kreme website during the build of the API.

GET /donuts/glazed-blueberry-cake-doughnut-holes // Return one donut from the API

/types

This API will return all of the possible types that you can filter on.

GET /donuts/glazed-blueberry-cake-doughnut-holes // Return one donut from the API

donutsapi's People

Contributors

aaronfrost avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.