This is a Node.js RESTful API for a Recipe App using MongoDB Atlas for data storage. The API allows users to manage recipes (create, read, update, delete) with features such as pagination and error handling.
- Node.js
- MongoDB Atlas account
- Postman/Insomnia for testing the API
- Create a MongoDB Atlas cluster.
- Obtain the connection string and replace
<username>and<password>in.envfile.
- Clone the repository and navigate to the project directory.
- Install dependencies:
npm install
Create a .env file with the following MONGO_URI=mongodb+srv://:@.mongodb.net/recipeapp PORT=5000
Start the server: bash
node server.js API Endpoints POST /api/recipes Create a new recipe.
GET /api/recipes Get all recipes.
GET /api/recipes/:id Get a recipe by its ID.
PUT /api/recipes/:id Update a recipe by its ID.
DELETE /api/recipes/:id Delete a recipe by its ID.
Testing Use Postman