Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
sofyan48 authored Feb 7, 2025
1 parent c95e269 commit 77eae50
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,28 @@ def http():
parser = argparse.ArgumentParser()
parser.add_argument("command", help="Perintah yang ingin Anda jalankan")
args = parser.parse_args()

from pkg.logger.logging import logger
if args.command == "serve":
host = os.getenv("APP_HOST", "0.0.0.0")
port = int(os.getenv("APP_PORT", "8080"))

is_reload = False
if utils.environment_transform() == 'loc':
is_reload = True
logging_config = None

logger.info("Starting Server", {
"host": host,
"port": port,
})

uvicorn.run(
app="app:app",
host=os.getenv("APP_HOST", "0.0.0.0"),
port=int(os.getenv("APP_PORT", "8080")),
host=host,
port=port,
reload=is_reload,
log_config=logging_config
log_config=logging_config,
access_log=True,
)
exit(0)

Expand Down

0 comments on commit 77eae50

Please sign in to comment.