This project is a simple REST API for managing users, supporting CRUD operations. It utilizes MongoDB as the database and follows RESTful principles, with responses in JSON format. Through this project, I learned how to create a REST API, use MongoDB for database operations, and perform CRUD operations using the REST API. Additionally, I learned to use the MVC pattern and Postman to test the APIs. This project was a stepping stone towards learning Node.js.
- GET /api/users
- Retrieves a list of all users.
- GET /api/users/:id
- Retrieves a user by their unique ID.
- POST /api/users
- Creates a new user.
- PATCH /api/users/:id
- Updates an existing user by their unique ID.
- DELETE /api/users/:id
- Deletes a user by their unique ID.
- GET /users
- Renders an HTML document listing all users.
- Node.js
- npm
- Clone the repository
git clone https://github.com/FarazF19/RESTAPI_Project1.git
2. Navigate to the project directory
```bash
cd RESTAPI_Project1
```
3. Install dependencies
```bash
npm install
```
### Running the Server
```bash
npm start
```
The server will start on `http://localhost:4000`.
### Using the API
Use tools like `curl`, `Postman`, or any REST client to interact with the API endpoints.
## Authors
- Faraz
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## Acknowledgements
Special thanks to Piyush Gard for his YouTube tutorial series on Node.js which was instrumental in learning the concepts applied in this project. Check out his channel: [Piyush Gard YouTube Channel](https://www.youtube.com/watch?v=ohIAiuHMKMI&list=PLinedj3B30sDby4Al-i13hQJGQoRQDfPo&index=1)
```
```