Skip to content

Repository files navigation


NestJS Backend Project

This is a simple NestJS backend project that provides a GET /info endpoint to return a JSON response containing email, current_datetime, and link. The current_datetime is returned in ISO 8601 format.


Table of Contents


Description

This project is a basic NestJS application designed to demonstrate how to create a RESTful API endpoint. The GET /info endpoint returns a JSON object with the following fields:

  • email: A placeholder email address.
  • current_datetime: The current date and time in ISO 8601 format.
  • github_url: A Github URL.

This project is ideal for learning NestJS basics, testing API endpoints, and integrating with frontend applications.


Setup Instructions

Prerequisites

  • Node.js (v16 or higher)
  • npm (Node Package Manager)
  • NestJS CLI (optional but recommended)

Steps to Run the Project Locally

  1. Clone the Repository

    git clone https://github.com/thamesblanq/zero-backend.git
    cd your-repo-name
  2. Install Dependencies

    npm install
  3. Start the Development Server

    npm run start:dev
  4. Access the Application

    • The server will start on http://localhost:3000.
    • You can test the GET /info endpoint using a browser, Postman, or ThunderClient.

API Documentation

Endpoint

  • URL: GET /info
  • Description: Returns a JSON object with email, current_datetime, and github_url.

Request/Response Format

Request

  • Method: GET
  • URL: http://localhost:3000/info
  • Headers: None required.

Response

  • Status Code: 200 OK
  • Body:
    {
      "email": "example@example.com",
      "current_datetime": "2025-01-31T12:34:56.789Z",
      "github_url": "https://github.com/thamesblanq/zero-backend"
    }

Example Usage

  1. Using cURL:

    curl -X GET http://localhost:3000/info
  2. Using ThunderClient:

    • Set the method to GET.
    • Set the URL to http://localhost:3000/info.
    • Send the request.
  3. Using a Browser:

    • Open http://localhost:3000/info in your browser.

Backlink

This project was created as part of the HNG Node.js Developers Program. Check out the program to learn more about building scalable backend systems with Node.js and NestJS.


License

This project is open-source and available under the MIT License.


About

HNG Zero Backend Project

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages