This project demonstrates a basic CRUD application using Node.js, Express, and MongoDB. It allows you to create, read, update, and delete users in a MongoDB database.
-
Clone the repository:
git clone https://github.com/yourusername/mongodbpractice.git cd mongodbpractice
-
Install dependencies:
npm install
-
Ensure MongoDB is running locally on port 27017.
-
Start the server:
node app.js
The server will run on http://localhost:3000.
-
Endpoints:
- Create a user:
GET /create
- Read all users:
GET /read
- Update a user:
GET /update
- Delete a user:
GET /delete
- Create a user:
Navigate to http://localhost:3000/create
to create a user with:
- Name: Awais
- Email: [email protected]
- Username: awais
Navigate to http://localhost:3000/read
to view all users.
Navigate to http://localhost:3000/update
to update a user with username abdulmanan4066
to name Abdul Manan Ilyas
.
Navigate to http://localhost:3000/delete
to delete the user with username awais
.
This project is licensed under the MIT License. See the LICENSE file for details.