Ready for a Host
Ready for a Host: Getting an API Ready for a Host, Where the Data Lives When Your API Is Online.
Updated
- Getting an API Ready for a Host (Journeyman): A host is a computer that's always on at an address anyone can reach, and a FastAPI project is ready for one when its requirements.txt pins every package, a .python-version file names its Python, its start command runs uvicorn with --host 0.0.0.0 and --port $PORT, its settings come from environment variables, and a /health route says it's working.
- Where the Data Lives When Your API Is Online (Journeyman): Render's free web service wipes its files every time it redeploys, restarts or spins down, so a SQLite file there holds demo data that the API seeds at startup when the database is empty, and keeping data for real takes a persistent disk or a hosted database such as PostgreSQL, which cost money.