Skip to content

Commit b159f84

Browse files
committed
feat: Add initial FastAPI monolith application with middleware and Podman Compose configuration, and include a factorial trailing zeros utility.
1 parent 07e511f commit b159f84

4 files changed

Lines changed: 15 additions & 0 deletions

File tree

maths/factorial_trailing_zeros.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
def factorial_trailing_zeros(n: int) -> int:
2+
def factorial(n):
3+
if n==1 or n==0:
4+
return 1
5+
fact = n* factorial(n-1)
6+
print(n, fact, sep='->')
7+
return fact
8+
return factorial(25)
9+
10+
11+
12+
13+
print(factorial_trailing_zeros(10))
122 Bytes
Binary file not shown.

microservices/fastapi/monolith/app/main.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ async def dispatch(self, request: Request, call_next):
4343

4444
@app.get("/")
4545
def read_root():
46+
logger.info("Received request to root endpoint")
4647
return {
4748
"message": f"Welcome to {settings.app_name}",
4849
"version": settings.app_version,
@@ -52,4 +53,5 @@ def read_root():
5253
@app.get("/health")
5354
def health_check():
5455
"""Health check endpoint for container orchestration."""
56+
logger.info("Received request to health check endpoint")
5557
return {"status": "healthy", "environment": settings.environment}

microservices/fastapi/monolith/app/podman-compose.yml

Whitespace-only changes.

0 commit comments

Comments
 (0)