A simple REST API to shorten a URL using FastAPI ⚡️.
It is assumed the following packages are installed before using HomeBrew on macOS:
brew install curl python@3.9
With Python3.9 in the PATH
, run the following to install Poetry (a package and dependency manager):
curl -sSL https://install.python-poetry.org | python -
Clone the project:
git clone https://github.com/aagaard/url_shortener_api
To configure poetry to install the virtual environment in the project and install the project inside the virtual environment
poetry config settings.virtualenvs.in-project true
poetry install
Run the web application in "production" mode (be aware the server is publicly available):
poetry run app/main.py
To run the web application in developer mode (reloads application for every file change):
poetry run uvicorn app.main:app --reload
poetry run pytest