https://github.com/coderooz/restful-api
This project will create a basic RESTful API for user management with CRUD operations (Create, Read, Update, Delete) using Node.js, Express, and a simple in-memory data store (you can replace this with a database like MongoDB for more advanced use).
https://github.com/coderooz/restful-api
Last synced: 12 months ago
JSON representation
This project will create a basic RESTful API for user management with CRUD operations (Create, Read, Update, Delete) using Node.js, Express, and a simple in-memory data store (you can replace this with a database like MongoDB for more advanced use).
- Host: GitHub
- URL: https://github.com/coderooz/restful-api
- Owner: coderooz
- License: mit
- Created: 2024-07-17T03:49:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-04T06:38:07.000Z (about 1 year ago)
- Last Synced: 2025-02-04T14:36:16.684Z (about 1 year ago)
- Language: JavaScript
- Size: 20.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# RESTful API
This is a simple RESTful API for user management with CRUD operations using Node.js and Express.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
You need to have Node.js and npm installed on your local machine.
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
### Installing
1. Clone the repository:
```bash
git clone https://github.com/coderooz/restful-api.git
cd restful-api
```
2. Install the dependencies:
```bash
npm install express body-parser
```
3. Start the server:
```bash
node index.js
```
### API Endpoints
- **Create a new user**
- `POST /users`
- Request body: `{ "name": "John Doe", "email": "john.doe@example.com" }`
- **Get all users**
- `GET /users`
- **Get a user by ID**
- `GET /users/:id`
- **Update a user by ID**
- `PUT /users/:id`
- Request body: `{ "name": "Jane Doe", "email": "jane.doe@example.com" }`
- **Delete a user by ID**
- `DELETE /users/:id`
### Usage
Use a tool like Postman or cURL to interact with the API endpoints.
### Built With
- [Express](https://expressjs.com/) - The web framework used
- [body-parser](https://www.npmjs.com/package/body-parser) - Middleware to parse request bodies
### Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
### Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/your-username/restful-api/tags).
### Authors
- **Ranit Saha** - [Coderooz](https://github.com/coderooz)
### License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details