#!/bin/sh

python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install uvicorn gunicorn hypercorn fastapi certifi poetry poetry-plugin-export
poetry self add poetry-plugin-export

pip show uvicorn | grep -E "Name:|Version:|Location:"
pip show gunicorn | grep -E "Name:|Version:|Location:"
pip show fastapi | grep -E "Name:|Version:|Location:"

pyenv local 3.13
poetry env activate
poetry lock
poetry install --no-root

#hypercorn main_package.app:app --reload -w $(nproc) --bind 0.0.0.0:8001
#poetry run hypercorn main_package/app:app --reload -w $(nproc) --bind 0.0.0.0:8001
#uvicorn main_package.app:app --reload --workers $(nproc) --host 0.0.0.0 --port 8001
uvicorn main_package.app:app --reload --workers $(nproc) --host 127.0.0.1 --port 8001
#gunicorn -b 0.0.0.0:8001 -k uvicorn.workers.UvicornWorker main_package.app:app
