This FastAPI project allows you to dynamically generate QR codes by sending a POST request with the desired content.
-
Clone the repository:
git clone https://github.com/AliHezarpisheh/qrcode-fastapi.git
-
Navigate to the project directory:
cd qrcode-fastapi/
-
Install dependencies using Poetry or pip:
Using Poetry:
poetry install
Using pip (activate virtual environment if necessary):
pip install -r requirements.txt
-
Run the FastAPI server using Uvicorn:
uvicorn main:app
-
Once the server is running, you can make a POST request to
/qrcode
with the content parameter in the query string. For example:curl -X POST "http://localhost:8000/qrcode?content=https://example.com"
This will generate a QR code with the content "https://example.com" and return the image.