Delicious CookieNewMunchies API is here! Discover delicious data

Munchies πŸͺ

πŸͺ Whip up some coding magic with Munchies API! πŸš€ Get tasty snack data that’ll make your apps pop 🌟 and keep your users munching with joy! πŸ˜‹πŸ•

βš™οΈ API Endpoints

πŸ” GET Methods

The following endpoints allow you to retrieve data from the Munchies API. πŸ“¦

πŸ” Get All Munchies

Use this endpoint to fetch a full list of available munchies.

GEThttps://munchies-v1.vercel.app/munchies

This will return a list of all munchie objects with their corresponding details. πŸ“„

Example Code:
axios.get('https://munchies-v1.vercel.app/munchies')
  .then(response => console.log(response.data))
  .catch(error => console.error('Error fetching munchies:', error));

🍱 Get Munchies by Category

Fetch munchies that belong to a specific category using this endpoint.

GEThttps://munchies-v1.vercel.app/munchies/category/:category

Replace :category with the desired munchie category.

Example Code:
const category = 'Snacks'; // example category
axios.get(`https://munchies-v1.vercel.app/munchies/category/${category}`)
  .then(response => console.log(response.data))
  .catch(error => console.error('Error fetching munchies by category:', error));

🍽 Get Munchie Categories

Use this endpoint to fetch all available munchie categories.

GEThttps://munchies-v1.vercel.app/munchies/categories

This will return a list of all available categories for munchies. πŸ“‚

Example Code:
axios.get('https://munchies-v1.vercel.app/munchies/categories')
  .then(response => console.log(response.data))
  .catch(error => console.error('Error fetching munchie categories:', error));

βž• POST Methods

These endpoints allow you to create new data entries in the Munchies API. πŸ“

πŸ• Add a Munchie

Use this endpoint to add a new munchie to the database.

POSThttps://munchies-v1.vercel.app/addmunchie

Request Body:

{
  "name": "Pizza",
  "category": "Snacks",
  "price": 9.99,
  "description": "Delicious cheesy pizza.",
  "imageUrl": "http://example.com/pizza.jpg"
}

This request will create a new munchie in the database with the provided details. πŸŽ‰

Example Code:
axios.post('https://munchies-v1.vercel.app/addmunchie', {
  name: "Pizza",
  category: "Snacks",
  price: 9.99,
  description: "Delicious cheesy pizza.",
  imageUrl: "http://example.com/pizza.jpg"
})
.then(response => console.log('Munchie added:', response.data))
.catch(error => console.error('Error adding munchie:', error));

πŸ”— Snack-tastic Resources!

Dive into our delicious APIs and savor the flavor of coding! πŸ˜‹

⭐️ Love what you see? Give us a star on GitHub! Your support is the sprinkles on our cupcake! 🧁

Munchies Playground! 🍽️✨

Add a New Munchie πŸ•