ced2950b60861ede87b27685248f8befad37ce1e
URL-shortener
URL-shortener project to showcase python use
Create venv
cd /opt/kjc/int/URL-shortener
python3 -m venv venv
source venv/bin/activate
Run locally
python -m uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
Then check:
http://127.0.0.1:8000
http://127.0.0.1:8000/docs
Test Short URL Endpoint:
http://127.0.0.1:8000/shorten
Running a test
PYTHONPATH=./ pytest
export PYTHONPATH=$(pwd)
python -m pytest --cov=app --cov-report=term-missing
Running Alembic revision
cd /opt/kjc/int/URL-shortener
alembic revision --autogenerate -m "create urls table"
Running project in Docker container
cd /opt/kjc/int/URL-shortener
docker compose up --build
Description
Production-ready URL Shortener built with FastAPI, PostgreSQL, Docker, and Alembic.
1.1 MiB
Releases
1
URL Shortener API v1.0.0
Latest
Languages
Python
95.1%
Mako
3.1%
Dockerfile
1%
Makefile
0.8%