diff --git a/backend/.env.example b/backend/.env.example index ccf23548..42272745 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -23,3 +23,6 @@ AWS_REGION_NAME= DAYTONA_API_KEY= DAYTONA_SERVER_URL= DAYTONA_TARGET= + +# Custom backend port +PORT= diff --git a/backend/api.py b/backend/api.py index 711e1e04..eb4743bc 100644 --- a/backend/api.py +++ b/backend/api.py @@ -11,6 +11,7 @@ import uuid import time from collections import OrderedDict +import os # Import the agent API module from agent import api as agent_api @@ -137,5 +138,5 @@ async def health_check(): if __name__ == "__main__": import uvicorn - logger.info("Starting server on 0.0.0.0:8000") - uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file + logger.info("Starting server on 0.0.0.0:{}".format(os.getenv("PORT", 8000))) + uvicorn.run(app, host="0.0.0.0", port=int(os.getenv("PORT", 8000))) \ No newline at end of file