Skip to content

A simple API server that returns a JSON response with a dynamically generated current datetime in ISO 8601 format (UTC), along with some predefined information about a user.

License

Notifications You must be signed in to change notification settings

paulwritescode/json-api-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

JSON API Server

A simple API server that returns a JSON response with a dynamically generated current datetime in ISO 8601 format (UTC), along with some predefined information about a user.

Project Description

This project is a Go-based HTTP server that handles GET requests and returns JSON responses. The JSON response includes the user's email, the current datetime in ISO 8601 format (UTC), and the user's GitHub URL.

Setup Instructions

Prerequisites

  • Go installed on your machine (version 1.16 or higher).
  • An internet connection to download dependencies.

Running the Project Locally

  1. Clone the repository:

    git clone https://github.com/yourusername/json-api-server.git
    cd json-api-server
  2. Build the project:

    go build
  3. Run the server:

    ./json-api-server

The server will start on port 3000.

API Documentation

Endpoint URL

GET /

Request

No request parameters are required.

Response

The response is in JSON format and includes the following fields:

  • email: The user's email.
  • current_datetime: The current datetime in ISO 8601 format (UTC).
  • github_url: The user's GitHub URL.

Example Response

{
  "email": "<user>@gmail.com",
  "current_datetime": "2025-01-31T20:30:00Z",
  "github_url": "https://github.com/<user>/hng-bootcamp"
}

About

A simple API server that returns a JSON response with a dynamically generated current datetime in ISO 8601 format (UTC), along with some predefined information about a user.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages