2022-10-08 23:36:16 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import uvicorn
|
|
|
|
|
|
|
|
from .settings import SETTINGS
|
|
|
|
|
|
|
|
|
2022-10-08 00:18:16 +00:00
|
|
|
def main() -> None:
|
2022-10-08 23:36:16 +00:00
|
|
|
"""
|
|
|
|
If the `main` script is run, `uvicorn` is used to run the app.
|
|
|
|
"""
|
|
|
|
|
|
|
|
uvicorn.run(
|
2023-09-03 15:55:49 +00:00
|
|
|
app="advent22_api.app:app",
|
2022-10-08 23:36:16 +00:00
|
|
|
host="0.0.0.0",
|
|
|
|
port=8000,
|
|
|
|
reload=not SETTINGS.production_mode,
|
|
|
|
)
|
2022-10-08 00:18:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
main()
|