Skip to content

Instantly share code, notes, and snippets.

@simply-alliv
Created July 23, 2020 00:09
Show Gist options
  • Save simply-alliv/d7bf33645dfc3fadb835715d7c2d0e85 to your computer and use it in GitHub Desktop.
Save simply-alliv/d7bf33645dfc3fadb835715d7c2d0e85 to your computer and use it in GitHub Desktop.
A function that returns a QR code, using the qrcode package.
/**
* ... Some lines omitted for brevity.
*/
import * as QRCode from 'qrcode';
class AuthenticationService {
...
public async respondWithQRCode(data: string, response: Response) {
QRCode.toFileStream(response, data);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment