ExpressAPI is a simple CRUD (Create, Read, Update, Delete) API built using Express.js, Prisma ORM, and MongoDB. It provides endpoints to manage user data stored in a MongoDB database.
- RESTful API endpoints for managing users
- MongoDB database integration with Prisma ORM
- Error handling for various scenarios, including invalid input and duplicate entries
- Easily extendable and customizable for future enhancements
- Clone the repository:
git clone <repository_url>
- Install dependencies:
npm install
- Set up Prisma:
npx prisma generate
- Start the server:
npm start
-
Use tools like Postman or curl to send HTTP requests to the defined endpoints.
-
Documentation for API endpoints:
- GET /user: Retrieves all users from the database.
- GET /user/:id: Retrieves a specific user by their ID.
- POST /user: Creates a new user.
- PUT /user: Updates an existing user's information.
- DELETE /user: Deletes all users from the database.
- DELETE /user/:id: Deletes a specific user by their ID.
Contributions are welcome! Feel free to open an issue or submit a pull request for any enhancements or fixes.