This is a simple API built using Node.js and Express, offering several endpoints for managing users and retrieving server information.
- Home Endpoint GET /
This endpoint returns a simple welcome message.
2. Add User Endpoint
POST /users
This endpoint allows you to add a new user by providing a name and email in the request body.
- Get All Users Endpoint GET /users
This endpoint returns a list of all users.
- Greet Endpoint GET /greet?name={SOME_NAME}
This endpoint returns a personalized greeting if a name is provided, or a default greeting otherwise.
- Info Endpoint GET /info
This endpoint returns server information, including the current time, client IP address, host name, and the number of registered users.
Requirements Node.js (v14 or later) Express.js
git clone https://github.com/Abubaker-Abeer/simple--api.git
cd simple--api
npm install
node app.js
The app will be available at http://localhost:3000.