- Features
- Technology Stack
- Project Structure
- Installation
- Local Development
- API Endpoints
- Usage Examples
- License
- Number Classification:
- Determines if the number is an Armstrong number.
- Checks if the number is prime.
- Checks if the number is a perfect number.
- Calculates the digit sum.
- Classifies the number as odd or even.
- Fun Fact Integration:
- Retrieves a fun math fact from the Numbers API.
- CORS Enabled:
- Allows cross-origin requests.
- Static File Handling:
- Serves a favicon from the static directory.
- Deployment Ready:
- Configured to run as a serverless function on Vercel using the
vercel-asgiadapter.
- Configured to run as a serverless function on Vercel using the
- Python 3.8+
- FastAPI: For building the API.
- Uvicorn: ASGI server for running the FastAPI app.
- Requests: For HTTP requests to the Numbers API.
- Docker: Containerization && Deployment
- main.py: Contains all the API logic, endpoints, and helper functions..
- static/favicon.ico: A favicon file to serve for the endpoint
/favicon.ico. - requirements.txt: Lists required packages and their versions.
- Dockerfile: Text file containing instructions for building and shipping the source code.
-
Clone the repository:
git clone https://github.com/Healerkay/HNG-Devops-Task
-
Create and activate a virtual environment::
python -m venv venvOn macOS/Linux: source venv/bin/activateOn Windows: venv\Scripts\activate -
Install dependencies:::
pip install -r requirements.txt
Ensure you have the static directory and a favicon.ico file in it.
Run the application using Uvicorn:
uvicorn main:app --reload
Root endpoint: http://127.0.0.1:8000/
API endpoint: http://127.0.0.1:8000/api/classify-number?number=371
Swagger UI documentation: http://127.0.0.1:8000/docs
Root endpoint:http://44.206.238.161:8000/
API endpoint: http://44.206.238.161:8000/api/classify-number?number=371



