This is a simple Node.js API that provides three endpoints: /hello
, /whattimeisit
, and /whatismyip
.
/hello
: Responds with "Hi there!" when accessed with a GET request./whattimeisit
: Responds with the current date and time in the format "YYYY-MM-DD HH:mm" when accessed with a GET request./whatismyip
: Responds with the requester's IP address when accessed with a GET request.
To use this API, follow these steps:
-
Clone the Repository:
Clone this repository to your local machine:
git clone https://github.com/your-username/sample-nodejs-api.git cd sample-nodejs-api
-
Install Dependencies:
Install the required dependencies using npm:
npm install
-
Run the Application:
Start the Node.js server to run the API:
node sample-nodejs-api.js
The API will be available at http://localhost:3000.
Contributions are welcome! Feel free to submit issues, pull requests, or feedback in the GitHub repository.