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.
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.
- Go installed on your machine (version 1.16 or higher).
- An internet connection to download dependencies.
-
Clone the repository:
git clone https://github.com/yourusername/json-api-server.git cd json-api-server
-
Build the project:
go build
-
Run the server:
./json-api-server
The server will start on port 3000.
GET /
No request parameters are required.
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.
{
"email": "<user>@gmail.com",
"current_datetime": "2025-01-31T20:30:00Z",
"github_url": "https://github.com/<user>/hng-bootcamp"
}