44 lines
900 B
Python
44 lines
900 B
Python
"""
|
|
Main entry point for the Loan Operations API.
|
|
"""
|
|
import uvicorn
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.core.config import settings
|
|
from app.resources import health
|
|
|
|
|
|
def create_app() -> FastAPI:
|
|
"""Create and configure the FastAPI application."""
|
|
|
|
app = FastAPI(
|
|
title="Loan Operations API",
|
|
description="SBA Loan Operations API",
|
|
version="1.0.0",
|
|
docs_url="/docs",
|
|
redoc_url="/redoc",
|
|
)
|
|
|
|
# Include all endpoint routers
|
|
app.include_router(health.router, tags=["health"])
|
|
|
|
return app
|
|
|
|
|
|
def main() -> None:
|
|
"""Run the application."""
|
|
|
|
uvicorn.run(
|
|
app,
|
|
host=settings.host,
|
|
port=settings.port,
|
|
log_level=settings.log_level.lower(),
|
|
reload=settings.debug,
|
|
)
|
|
|
|
app = create_app()
|
|
|
|
if __name__ == "__main__":
|
|
main()
|