Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍲 Recipe Sharing API

A simple Recipe Sharing API built with Node.js + Express. This API allows users to add and view recipes. It also comes with a basic frontend for testing.


🚀 How to Run the Project Locally

  1. Clone the repository:

    git clone https://github.com/rinu143/recipe-api-rinu.git
    cd recipe-api-rinu
  2. Install dependencies:

    npm install
  3. Start the server:

    npm start
  4. Open your browser and go to:

    http://localhost:5000
    

🌐 Deployed API URL

Your live API is hosted on Render: 👉 https://recipe-api-rinu.onrender.com


📌 API Endpoint Documentation

1. Add a new recipe (POST)

  • Endpoint: /recipes

  • Method: POST

  • Request Body (JSON):

    {
      "title": "Pasta Alfredo",
      "ingredients": ["Pasta", "Cream", "Cheese"],
      "instructions": "Boil pasta, mix with sauce and cheese.",
      "cookTime": "20 minutes"
    }
  • Response:

    {
      "id": 1694781203947,
      "title": "Pasta Alfredo",
      "ingredients": ["Pasta", "Cream", "Cheese"],
      "instructions": "Boil pasta, mix with sauce and cheese.",
      "cookTime": "20 minutes",
      "difficulty": "medium"
    }

2. Get all recipes (GET)

  • Endpoint: /recipes

  • Method: GET

  • Response (JSON array):

    [
      {
        "id": 1694781203947,
        "title": "Pasta Alfredo",
        "ingredients": ["Pasta", "Cream", "Cheese"],
        "instructions": "Boil pasta, mix with sauce and cheese.",
        "cookTime": "20 minutes",
        "difficulty": "medium"
      },
      {
        "id": 1694781256789,
        "title": "Tomato Soup",
        "ingredients": ["Tomatoes", "Onion", "Garlic", "Salt"],
        "instructions": "Boil tomatoes with onion and garlic, blend, and season.",
        "cookTime": "15 minutes",
        "difficulty": "medium"
      }
    ]

About

A simple Recipe Sharing API built with Node.js + Express. This API allows users to add and view recipes. It also comes with a basic frontend for testing.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages