🏃 💽 ❎ - Uvicorn¶
👑 👜 👆 💪 🏃 FastAPI 🈸 🛰 💽 🎰 🔫 💽 📋 💖 Uvicorn.
📤 3️⃣ 👑 🎛:
💽 🎰 & 💽 📋¶
📤 🤪 ℹ 🔃 📛 ✔️ 🤯. 👶
🔤 "💽" 🛎 ⚙️ 🔗 👯♂️ 🛰/☁ 💻 (⚛ ⚖️ 🕹 🎰) & 📋 👈 🏃♂ 🔛 👈 🎰 (✅ Uvicorn).
✔️ 👈 🤯 🕐❔ 👆 ✍ "💽" 🏢, ⚫️ 💪 🔗 1️⃣ 📚 2️⃣ 👜.
🕐❔ 🔗 🛰 🎰, ⚫️ ⚠ 🤙 ⚫️ 💽, ✋️ 🎰, 💾 (🕹 🎰), 🕸. 👈 🌐 🔗 🆎 🛰 🎰, 🛎 🏃♂ 💾, 🌐❔ 👆 🏃 📋.
❎ 💽 📋¶
👆 💪 ❎ 🔫 🔗 💽 ⏮️:
🏃 💽 📋¶
👆 💪 ⤴️ 🏃 👆 🈸 🎏 🌌 👆 ✔️ ⌛ 🔰, ✋️ 🍵 --reload
🎛, ✅:
$ uvicorn main:app --host 0.0.0.0 --port 80
<span style="color: green;">INFO</span>: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
$ hypercorn main:app --bind 0.0.0.0:80
Running on 0.0.0.0:8080 over http (CTRL + C to quit)
Warning
💭 ❎ --reload
🎛 🚥 👆 ⚙️ ⚫️.
--reload
🎛 🍴 🌅 🌅 ℹ, 🌅 ⚠, ♒️.
⚫️ ℹ 📚 ⏮️ 🛠️, ✋️ 👆 🚫🔜 🚫 ⚙️ ⚫️ 🏭.
Hypercorn ⏮️ 🎻¶
💃 & FastAPI ⚓️ 🔛 AnyIO, ❔ ⚒ 👫 🔗 ⏮️ 👯♂️ 🐍 🐩 🗃 ✳ & 🎻.
👐, Uvicorn ⏳ 🕴 🔗 ⏮️ ✳, & ⚫️ 🛎 ⚙️ uvloop
, ↕-🎭 💧-♻ asyncio
.
✋️ 🚥 👆 💚 🔗 ⚙️ 🎻, ⤴️ 👆 💪 ⚙️ Hypercorn ⚫️ 🐕🦺 ⚫️. 👶
❎ Hypercorn ⏮️ 🎻¶
🥇 👆 💪 ❎ Hypercorn ⏮️ 🎻 🐕🦺:
$ pip install "hypercorn[trio]"
---> 100%
🏃 ⏮️ 🎻¶
⤴️ 👆 💪 🚶♀️ 📋 ⏸ 🎛 --worker-class
⏮️ 💲 trio
:
$ hypercorn main:app --worker-class trio
& 👈 🔜 ▶️ Hypercorn ⏮️ 👆 📱 ⚙️ 🎻 👩💻.
🔜 👆 💪 ⚙️ 🎻 🔘 👆 📱. ⚖️ 👍, 👆 💪 ⚙️ AnyIO, 🚧 👆 📟 🔗 ⏮️ 👯♂️ 🎻 & ✳. 👶
🛠️ 🔧¶
👫 🖼 🏃 💽 📋 (📧.Ⓜ Uvicorn), ▶️ 👁 🛠️, 👂 🔛 🌐 📢 (0.0.0.0
) 🔛 🔁 ⛴ (✅ 80
).
👉 🔰 💭. ✋️ 👆 🔜 🎲 💚 ✊ 💅 🌖 👜, 💖:
- 💂♂ - 🇺🇸🔍
- 🏃♂ 🔛 🕴
- ⏏
- 🧬 (🔢 🛠️ 🏃)
- 💾
- ⏮️ 🔁 ⏭ ▶️
👤 🔜 💬 👆 🌅 🔃 🔠 👫 🔧, ❔ 💭 🔃 👫, & 🧱 🖼 ⏮️ 🎛 🍵 👫 ⏭ 📃. 👶