Minimal QR code generator hosted within the free tier on Cloudflare Workers through aggressive caching. Uses npm qrcode under the hood.
Used by PR Preview Action to display QR codes for preview links.
<img
src="https://qr.rossjrw.com/?url=https://github.com/rossjrw/qrcode-worker"
width="80"
/>The QR code image is always returned as an SVG without implicit sizing, able to be displayed at whatever scale is needed.
The url query parameter should be URI-encoded.
Some qrcode options are supported as query parameters:
errorCorrectionLevel: L, M, Q, H (default: L)color.dark,color.light: RGB hex code without leading #margin: number (default: 1)
<img
src="https://qr.rossjrw.com/
?url=https://github.com/rossjrw/qrcode-worker
&errorCorrectionLevel=H
&color.dark=f00
&color.light=00f
&margin=5
"
width="80"
/>qr.rossjrw.com is built for PR Preview Action but I'm not going to be moderating its usage unless someone starts causing problems.
To that effect, I reserve the right at any time and without notice to terminate the service or change its output.
All other hosted QR code services, whether free or paid, also reserve this right, whether they choose to be explicit about it or not.
This codebase uses the MIT license. Feel free to fork it, change whatever you like (e.g. the terms of use) and redeploy it for your own use.
To deploy as a Cloudflare worker, create a worker and hook up the forked git repo. Cloudflare provides a free domain for it, but you could add a custom one if you like. That's it.
Aggressive worker caching is already included.