Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/paulwritescode/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.
https://github.com/paulwritescode/json-api-server
cors data-generation error-handling golang http-server http-status-code json json-marshalling
Last synced: 1 day ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/paulwritescode/json-api-server
- Owner: paulwritescode
- License: mit
- Created: 2025-01-31T17:53:45.000Z (13 days ago)
- Default Branch: main
- Last Pushed: 2025-01-31T21:03:23.000Z (12 days ago)
- Last Synced: 2025-01-31T22:18:50.553Z (12 days ago)
- Topics: cors, data-generation, error-handling, golang, http-server, http-status-code, json, json-marshalling
- Language: Go
- Homepage: https://hng-bootcamp-production.up.railway.app/
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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:**
```sh
git clone https://github.com/yourusername/json-api-server.git
cd json-api-server
```2. **Build the project:**
```sh
go build
```3. **Run the server:**
```sh
./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
```json
{
"email": "@gmail.com",
"current_datetime": "2025-01-31T20:30:00Z",
"github_url": "https://github.com//hng-bootcamp"
}
```