Skip to content

A simple Node.js API with endpoints to greet, provide current date and time, and display requester's IP address.

Notifications You must be signed in to change notification settings

cemonal/sample-nodejs-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Node.js API

This is a simple Node.js API that provides three endpoints: /hello, /whattimeisit, and /whatismyip.

Endpoints

  • /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.

Getting Started

To use this API, follow these steps:

  1. 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
  2. Install Dependencies:

    Install the required dependencies using npm:

    npm install
  3. 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.

Contributing

Contributions are welcome! Feel free to submit issues, pull requests, or feedback in the GitHub repository.

About

A simple Node.js API with endpoints to greet, provide current date and time, and display requester's IP address.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published