This repository contains a simple FastAPI-based public API that fulfills the HNG12 Stage 0 backend task requirements. The API provides basic information including the current UTC datetime, registered email address, and the GitHub repository URL.
- Provides the current UTC datetime in ISO 8601 format.
- Returns registered email and GitHub repository URL.
- Handles Cross-Origin Resource Sharing (CORS) with proper configuration.
- Designed to be deployed on a publicly accessible endpoint.
URL: /
Method: GET
Response Example:
{
"email": "[email protected]",
"current_datetime": "2025-01-30T09:30:00Z",
"github_url": "https://github.com/Anofff/HNG12-PublicAPI"
}
- Programming Language/Framework: Python (FastAPI)
- Deployment: Hosted on a publicly accessible platform (e.g., Render).
- Version Control: Public GitHub repository.
- Response Format: JSON.
Clone this repository to your local machine:
git clone https://github.com/Anofff/HNG12-PublicAPI.git
cd HNG12-PublicAPI
Ensure you have Python 3.8+ installed, then run:
pip install -r requirements.txt
Start the FastAPI server using Uvicorn:
uvicorn app:app --host 0.0.0.0 --port 8000
- Base URL:
http://127.0.0.1:8000/
- Swagger UI:
http://127.0.0.1:8000/docs
- You can access this API remotely at: HNG-PublicAPI
- Endpoint:
/
- Method:
GET
- Response Format: JSON
{
"email": "[email protected]",
"current_datetime": "2025-01-30T09:30:00Z",
"github_url": "https://github.com/Anofff/HNG12-PublicAPI"
}
For more details about HNG12 backend roles and hiring, visit:
- Hire Python Developers
- Hire C# Developers
- Hire Golang Developers
- Hire PHP Developers
- Hire Java Developers
- Hire Node.js Developers
- Email: [email protected]
- GitHub: Anofff