This is a Node.js and Express.js-based REST server project that provides an API for managing users. The server is started at the "localhost:8080/api/user" route and offers the following endpoints to interact with the user collection:
Ensure you have Node.js and npm (Node Package Manager) installed on your system before running this project. You can download and install them from nodejs.org.
-
Clone this repository to your local machine:
git clone https://github.com/ErickGBR/REST-Server.git
-
Navigate to the project directory:
cd REST-Server
-
Install the dependencies using npm:
npm i
To start the server, use the following command:
npm start
The server will run at http://localhost:8080/api/user
.
Below are the available endpoints and corresponding HTTP verbs to interact with the user collection:
- URL:
/api/user
- HTTP Verb: POST
- Description: Create a new user and add them to the user collection.
- Request Parameters:
name
: User's name (string).age
: User's age (integer).
- URL:
/api/user
- HTTP Verb: GET
- Description: Retrieve the complete list of users.
- URL:
/api/user/:id
- HTTP Verb: PUT
- Description: Update a specific user by their ID.
- Request Parameters:
id
: User ID (string).
- Request Parameters (any combination of the following):
name
: New user name (string).age
: New user age (integer).
- URL:
/api/user/:id
- HTTP Verb: DELETE
- Description: Delete a specific user by their ID.
- Request Parameters:
id
: User ID (string).
- URL:
/api/user/:id
- HTTP Verb: PATCH
- Description: Partially update a specific user by their ID.
- Request Parameters:
id
: User ID (string).
- Request Parameters (any combination of the following):
name
: New user name (string).email
: New user email (string).age
: New user age (integer).
If you would like to contribute to this project, please follow these contribution guidelines:
- Fork the repository.
- Create a branch for your contribution.
- Make your changes and ensure that the tests pass.
- Submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for more details.
Thank you for using this Node and Express REST server! If you have any questions or suggestions, please feel free to contact us.
Author: Erick Burgos Email: erickburgos1519@gmail.com