Welcome to the Node.js Express MongoDB Mock Server! This project provides a mock server setup using Node.js, Express, and MongoDB. It's designed to help you create a simulated API with sample CRUD operations.
- Node.js and Express: A lightweight and efficient server setup for handling HTTP requests.
- MongoDB: A NoSQL database for storing and retrieving mock data.
- Sample CRUD Operations: Includes endpoints for Create, Read, Update, and Delete operations.
- Easy to Customize: Adapt the mock server to suit your specific needs by modifying routes and data models.
- Clone the repository:
git clone <repository-url>
- Install dependencies:
npm install
oryarn install
- Start the server:
npm run dev
oryarn run dev
/models
: MongoDB data models for defining the structure of mock data./routes
: Express route handlers for different API endpoints.server.js
: Main server file containing the server configuration.
Feel free to customize and extend this mock server based on your project requirements. Use it for development, testing, or as a starting point for building more complex APIs.
- GET /api/items: Get all items.
- GET /api/items/:id: Get a specific item by ID.
- POST /api/items: Create a new item.
- PUT /api/items/:id: Update an existing item.
- DELETE /api/items/:id: Delete an item by ID.
Contributions are welcome! If you encounter issues, have improvements, or want to add new features, please open an issue or submit a pull request.
This project is licensed under the MIT License.