diff --git a/Dockerfile b/Dockerfile index 32a2918..5f83702 100644 --- a/Dockerfile +++ b/Dockerfile @@ -17,4 +17,4 @@ RUN uv sync --frozen --no-install-project RUN uv sync --frozen # Command to run the app when the container starts -CMD ["uv", "run", "test_main.py"] +CMD ["uv", "run", "main.py"] diff --git a/src/main.py b/main.py similarity index 91% rename from src/main.py rename to main.py index 5a8e58f..0898c04 100644 --- a/src/main.py +++ b/main.py @@ -1,7 +1,7 @@ from fastapi import FastAPI from fastapi.responses import RedirectResponse -from src.routers.health import health_router -from src.routers.mtcars import data_output +from routers.health import health_router +from routers.mtcars import data_output import uvicorn import tomllib @@ -20,7 +20,7 @@ # Description of API defined in docs/documentation.py for ease of reading description=description, summary="This project is a proof-of-concept (POC) web API built using the FastAPI library.", - version=version, + version="0.0.1", contact={ "name": "RMI", "url": "https://github.com/RMI", diff --git a/test_main.py b/test_main.py deleted file mode 100644 index e6aada7..0000000 --- a/test_main.py +++ /dev/null @@ -1,37 +0,0 @@ -from fastapi import FastAPI -from fastapi.responses import RedirectResponse -from routers.health import health_router -from routers.mtcars import data_output -from docs.documentation import description -import uvicorn - -app = FastAPI( - # This info goes directly into /docs - title="RMI Web API poc", - # Description of API defined in docs/documentation.py for ease of reading - description=description, - summary="This project is a proof-of-concept (POC) web API built using the FastAPI library.", - version="0.0.1", - contact={ - "name": "RMI", - "url": "https://github.com/RMI", - }, - license_info={ - "name": "MIT", - "url": "https://github.com/RMI/web-api-poc/blob/main/LICENSE.txt", - }, -) - - -@app.get("/") -async def redirect(): - response = RedirectResponse(url="/docs") - return response - - -app.include_router(health_router) -app.include_router(data_output) - - -if __name__ == "__main__": - uvicorn.run("main:app", host="0.0.0.0", port=5000, log_level="info")