Generate a QR code returned as base64 String.
1
import { qrcode } from "https://deno.land/x/qrcode@v2.0.0/mod.ts";
2
3
export async function main(qr_url: string) {
4
const base64Image = qrcode(`${qr_url}`); // data:image/gif;base64,...
5
6
return base64Image;
7
}
8
export async function main(qr_url = "https://google.com") {
const base64Image = await qrcode(`${qr_url}`); // data:image/gif;base64,...
return { 'html': `<iframe style="width:100vh;height:100vh" src="${base64Image}" frameborder="0"></iframe>` }