File size: 1,167 Bytes
b6dcc89
9b32714
 
 
 
 
 
 
 
 
 
 
9a961b7
 
 
 
9b32714
 
 
 
b6dcc89
 
9a961b7
9b32714
 
 
 
 
 
 
 
 
 
 
 
 
b6dcc89
9b32714
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from fastapi import FastAPI
from fastapi.responses import HTMLResponse

# ==========================
# πŸ“Œ Image Module
# ==========================
from app.routers.image import jpgcompressor


# ==========================
# πŸ§ͺ Test Utilities
# ==========================
from app.routers.testers import random_number_generator
from app.routers.testers import help
from app.routers.testers import calculator


# ==========================
# πŸš€ App Initialization
# ==========================
app = FastAPI()


# ==========================
# πŸ”— Router Registration
# ==========================
app.include_router(jpgcompressor.router)              # Image compression handler
app.include_router(random_number_generator.router)    # Random number tester
app.include_router(help.router)                       # Helper/test info
app.include_router(calculator.router)                 # Mini calculator service


# ==========================
# 🌐 Root Endpoint
# ==========================
@app.get("/", response_class=HTMLResponse)
def greet_json():
    return """
    <h2>Go to the Swagger docs πŸ‘‡</h2>
    <a href="/docs">Click here for API Docs</a>
    """