This project is a Flask web app, so on Render you should create a Web Service (not a Static Site).
Render needs a production WSGI server. Add gunicorn to requirements.txt.
Example requirements.txt:
Flask==3.0.3
requests==2.32.3
gunicorn==22.0.0Render deploys from your repository, so push the latest changes.
On Render:
- Click New + → Web Service
- Select your GitHub repo
- Choose the branch (usually
main) - Pick Instance Type: Free
Use:
pip install -r requirements.txtRender’s autofill like gunicorn your_application.wsgi is not correct for this repo.
Use this exact command:
gunicorn -w 1 -b 0.0.0.0:$PORT app:appMeaning:
app:app→ fileapp.py, Flask object namedapp$PORT→ Render injects this environment variable automatically-w 1→ single worker is safer here because this app uses a JSON file store
Click Deploy Web Service.
After it finishes, open the provided Render URL.
- Health endpoint:
/health - Main UI:
/
This app stores links in data/url_store.db (SQLite).
On Render Free, instances can spin down and do not support persistent disks, so the database file can be lost on redeploy/sleep.
If you need the links to be reliably saved:
- Use a paid instance with a persistent disk, or
- Change storage to a database (e.g., SQLite/Postgres).
Most commonly the Start Command is wrong.
Double-check it is:
gunicorn -w 1 -b 0.0.0.0:$PORT app:appAdd gunicorn==22.0.0 to requirements.txt, commit, push, redeploy.
The TinyURL API call is an external request. If TinyURL is down or rate-limits you, the app may return tiny_url: null.
You can set a custom database path using:
SHARPLINK_DB_PATH=/var/data/url_store.dbConfigure a persistent rate limit backend (Redis):
RATELIMIT_STORAGE_URI=redis://:<password>@<host>:6379/0If you don’t have Redis, the app will fall back to in-memory limits (not recommended for production).