Spice & Slice is a cozy eatery serving a fusion of classic Italian favorites and Indian-inspired dishes. We focus on fresh ingredients, bold flavors, and a friendly dining experience.
This project implements a simple Restaurant Menu Display API using Node.js and Express.js and a frontend HTML page that fetches data from the API using fetch(). The API provides endpoints to get all menu items, vegetarian items, and menu categories with counts.
Technologies used: Node.js, Express.js, HTML, CSS, JavaScript.
- Appetizer
- Main Course
- Dessert
- Beverage
Spice & Slice is a small demo project that implements a simple Restaurant Menu Display API using Node.js and Express, plus a minimal static frontend that fetches data from the API.
- Node.js + Express
- HTML, CSS, vanilla JavaScript (frontend)
https://github.com/basithabbasks/-Restaurant-Menu-Display-API
restaurant-menu-api/
├─ public/
│ ├─ index.html
│ ├─ style.css
│ └─ script.js
├─ package.json
├─ README.md
└─ server.js
Prerequisites: Node.js (14+), npm
Clone and install:
git clone https://github.com/basithabbasks/-Restaurant-Menu-Display-API.git
cd restaurant-menu-api
npm installRun the server (default port 3000):
npm startThen open the frontend in your browser:
- The server uses
process.env.PORTif set. To run on a different port:
$env:PORT=4000; npm start- GET /menu — returns all menu items
- GET /menu/vegetarian — returns only vegetarian items
- GET /menu/categories — returns unique categories and item counts
Get all menu items:
curl http://localhost:3000/menuGet vegetarian items:
curl http://localhost:3000/menu/vegetarianGet categories:
curl http://localhost:3000/menu/categoriesThe public/index.html page fetches /menu on load and displays the items. It is served statically by server.js.
- Feel free to open issues or submit pull requests.
- If you add features, please include tests (if applicable) and update this README.
This project is published under the MIT license. See the LICENSE file.
Your Name