Spaces:
Running
Running
File size: 816 Bytes
c7426d8 e3a12d5 c7426d8 e3a12d5 c7426d8 |
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 |
"""Module to handle the main FastAPI application and its endpoints."""
import logging
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from router import content, mail
app = FastAPI(docs_url="/")
app.include_router(content.router, tags=["content"])
app.include_router(mail.router, tags=["mail"])
origins = [
"*"
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials = True,
allow_methods=["*"],
allow_headers=["*"],
)
logging.basicConfig(
format='%(asctime)s - %(levelname)s - %(funcName)s - %(message)s')
logging.getLogger().setLevel(logging.ERROR)
@app.get("/_health")
def health():
"""
Returns the health status of the application.
:return: A string "OK" indicating the health status.
"""
return "OK"
|