Skip to content

Abubaker-Abeer/simple--api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple--api

This is a simple API built using Node.js and Express, offering several endpoints for managing users and retrieving server information.

Endpoints

  1. Home Endpoint GET /

This endpoint returns a simple welcome message. Screenshot 2024-09-18 030737 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.

  1. Get All Users Endpoint GET /users

This endpoint returns a list of all users. Screenshot 2024-09-18 031404

  1. Greet Endpoint GET /greet?name={SOME_NAME}

This endpoint returns a personalized greeting if a name is provided, or a default greeting otherwise. Screenshot 2024-09-18 030858 Screenshot 2024-09-18 030805

  1. Info Endpoint GET /info

This endpoint returns server information, including the current time, client IP address, host name, and the number of registered users. Screenshot 2024-09-18 031259

Test code:

Screenshot 2024-09-18 043912

Project Setup

Requirements Node.js (v14 or later) Express.js

Running the App Locally:

1. Clone the Repository:

git clone https://github.com/Abubaker-Abeer/simple--api.git
cd simple--api

2.Install the dependencies:

npm install

3. Start the server:

node app.js

The app will be available at http://localhost:3000.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published