This project implements a REST API for a hypothetical online restaurant service. It allows users to manage products (menu items), place orders, and view order history.
- CRUD operations for managing products (menu items)
- Place orders for products
- View order history
- Node.js
- Express.js
- MongoDB
- body-parser
- mongoose
- express-async-handler
- nodemon
-
Clone the repository:
git clone https://github.com/yourusername/online-restaurant-service.git
-
Navigate to the project directory
cd online-restaurant-service
-
Install dependencies:
npm install
-
Create a .env file in the root directory and define the following environment variables:
PORT=5000 MONGODB_URI=your_mongodb_connection_uri
Start the server:
npm start
The API will be available at http://localhost:5000.
- GET: Get all products
- POST: Create a new product
- GET: Get a product by ID
- PATCH: Update a product by ID
- DELETE: Delete a product by ID
- GET: Get all orders
- POST: Place a new order
- GET: Get an order by ID
This project is licensed under the ISC License.