Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
WasinUddy authored Aug 19, 2024
1 parent 4ddbaa1 commit d9b9c82
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion web/backend/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@

import os
import argparse
import logging

# Configure logging to log only errors
logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger("uvicorn.error")
logger.setLevel(logging.ERROR)

# Parse command line arguments
parser = argparse.ArgumentParser(description='Start montainer server with specified architecture.')
Expand Down Expand Up @@ -118,4 +124,10 @@ def liveness():

# Get the port from the environment variable
port = int(os.environ.get("WEBPORT", 8000))
uvicorn.run(app, host="0.0.0.0", port=port)
uvicorn.run(app, host="0.0.0.0", port=port)
# Start the FastAPI server
import uvicorn

# Get the port from the environment variable
port = int(os.environ.get("WEBPORT", 8000))
uvicorn.run(app, host="0.0.0.0", port=port)

0 comments on commit d9b9c82

Please sign in to comment.