Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farazf19/restapi_project1
REST API Practice Project-1
https://github.com/farazf19/restapi_project1
backend express-js json mockaroo restapi
Last synced: about 2 months ago
JSON representation
REST API Practice Project-1
- Host: GitHub
- URL: https://github.com/farazf19/restapi_project1
- Owner: FarazF19
- Created: 2024-07-15T09:28:28.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-07-20T08:21:17.000Z (5 months ago)
- Last Synced: 2024-07-20T09:35:13.026Z (5 months ago)
- Topics: backend, express-js, json, mockaroo, restapi
- Language: JavaScript
- Homepage:
- Size: 3.07 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# REST API Project
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.
## Endpoints
### Get All Users
- **GET /api/users**
- Retrieves a list of all users.### Get User by ID
- **GET /api/users/:id**
- Retrieves a user by their unique ID.### Create a New User
- **POST /api/users**
- Creates a new user.### Update a User by ID
- **PATCH /api/users/:id**
- Updates an existing user by their unique ID.### Delete a User by ID
- **DELETE /api/users/:id**
- Deletes a user by their unique ID.### Render HTML Document
- **GET /users**
- Renders an HTML document listing all users.## Getting Started
### Prerequisites
- Node.js
- npm### Installing
1. Clone the repository
```bash
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)
```
```