/backend-hng-task-0

Develop a public API that returns email address, current time and Github URL

Primary LanguageJavaScript

Backend HNG Task 0

Description

This is a simple backend API built with node.js. It provides an endpoint that returns essential details, including the developer's email, the current datetime, and a link to the project's GitHub repository. The API is lightweight and serves as an introduction to backend development. Task from HNG, Checkout hng.backlink

Features

  • Returns developer email.
  • Provides the current datetime dynamically.
  • Includes a link to the GitHub repository.
  • CORS enabled for cross-origin requests.

Tech Stack

  • Node.js - JavaScript runtime environment.
  • Express.js - Web framework for Node.js.
  • CORS - Middleware to handle cross-origin resource sharing.

Setup Instructions

Prerequisites

Ensure you have the following installed on your machine:

  • Node.js (LTS recommended)
  • npm (comes with Node.js)

Installation & Running Locally

  1. Clone the repository:
    git clone https://github.com/G4EVA-dev/backend-hng-task-0.git
  2. Navigate into the project directory:
    cd backend-hng-task-0
  3. Install dependencies:
    npm install
  4. Start the server:
    node index.js
  5. The API will be available at:
    http://localhost:3000/
    

API Documentation

Endpoint: GET /

URL:

https://backend-hng-task-0.onrender.com

Response Format:

  • 200 OK
  • JSON response with the following structure:
    {
      "email": "tanzeglenn@gmail.com",
      "current_datetime": "2025-01-01T12:00:00.000Z",
      "github_url": "https://github.com/G4EVA-dev/backend-hng-task-0"
    }