A simple url shortener written using fastapi, sqlalchemy, and sqlite
POST /url
Request: {target: "validurl"}
e
x: {target: "https://www.google.com"}
Response: {target: "validurl", short:"shortenedurlcode"}
ex: {target: "https://www.google.com", short:"PSck3o"}
GET /{short}
Request: query param of short, ex: 127.0.0.1:8000/PSck3o
Response: if short exists, redirect. otherwise return not found.
Typical venv setup -
python3 -m venv venv
source venv/bin/activate
python -m pip install -r requirements.txt
uvicorn app.main:app --reload
pytest tests/