Skip to content

Latest commit

 

History

History
34 lines (21 loc) · 1.47 KB

README.md

File metadata and controls

34 lines (21 loc) · 1.47 KB

FaaS qrcode

Go Report Card

This repo contains an example FaaS function which uses the skip2/go-qrcode Go library to generate a QR Code for a string.

Deploying the Function

Make sure you have deployed a FaaS stack to your cluster using the instructions on the FaaS repo.

Use the CLI (faas-cli)

Get the CLI

The faas-cli can be installed via brew install faas-cli or curl -sSL https://get.openfaas.com | sudo sh.

Now deploy the function as follows:

# faas-cli -action deploy -image=faasandfurious/qrcode -name=qrcode -fprocess="/usr/bin/qrcode"
200 OK
URL: http://localhost:8080/function/qrcode

Testing the Function

Now that the function is running in your FaaS environment you can test it from the command line by running:

$ curl localhost:8080/function/qrcode --data "https://github.com/alexellis/faas" > qrcode.png

You can check the QR code works using your phone, or an online QR Code decoder (ZXing Decoder Online for example)