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.
-
Clone the repository:
git clone https://github.com/rinu143/recipe-api-rinu.git cd recipe-api-rinu -
Install dependencies:
npm install
-
Start the server:
npm start
-
Open your browser and go to:
http://localhost:5000
Your live API is hosted on Render: 👉 https://recipe-api-rinu.onrender.com
-
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" }
-
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" } ]