When ran the server listens for GET
requests at /qr
endpoint with a url
parameter from the query string and uses the qrcode library to create a QR code image. It then saves the image to a buffer and creates a response object with the contents of the buffer. Finally, it returns the response object with the QR code image. It also automatically downloads it.
Install the following
- flask
- qrcode
Windows 🪟
pip install flask qrcode
MacOS🍎 & Linux🐧
pip install flask qrcode
- Run a server
Windows 🪟
python main.py
MacOS🍎 & Linux🐧
python3 main.py
- Make a get request to
/qr
endpoint with aurl
parameter, like below 👇. Paste in your browser search bar.
https://localhost:5000/qr?url=https://www.example.com