A simple REST API that provides information about traditional Peruvian dishes, built with Node.js and Express.
git clone https://github.com/yourusername/peruvian-food-api.git
cd peruvian-food-api
npm install
npm run dev
http://localhost:3000
Method | Endpoint | Description |
---|---|---|
GET | / | Welcome message and available endpoints |
GET | /api/foods | Get all foods (with optional filters) |
GET | /api/foods/:id | Get a specific food by ID |
You can filter the /api/foods
endpoint using the following query parameters:
search
: Filter foods by name (case-insensitive partial match)category
: Filter by category (‘main’, ‘dessert’, ‘drink’)isSpicy
: Filter by spiciness (‘true’ or ‘false’)GET /api/foods
GET /api/foods/1
GET /api/foods?search=chi
GET /api/foods?category=dessert
GET /api/foods?isSpicy=true
GET /api/foods?search=gallina&category=main&isSpicy=true
peruvian-food-api/
├── node_modules/
├── src/
│ ├── data/
│ │ └── foods.js # Sample food data
│ ├── routes/
│ │ └── foodRoutes.js # API routes for food resources
│ └── index.js # Main application file
├── .gitignore
├── package.json
├── package-lock.json
└── README.md
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Elliot Garamendi as a learning project