Skip to content

Example of a downloads vending machine using Alby API for payments and Magalu Object API for objects hosting

License

Notifications You must be signed in to change notification settings

marmotitude/video-vending-machine

Repository files navigation

content-vending-machine

Example of a downloads vending machine using a service API(alby? opennode?) for payments and Magalu Object API for objects hosting

as featured in this presentation

Demo

cp .env.example .env
vim .env
node .
# generate invoice to unlock the download
curl localhost:3000/products/a/invoice | jq . | tee product_a_invoice.json

# print the invoice as a QR Code in the terminal (and pay it with a mobile wallet)
cat product_a_invoice.json | jq -r .payment_request | ./node_modules/.bin/qrcode-terminal

# print the temporary download URL of the paid product (will have status 402 if not paid)
curl -v localhost:3000/products/a/download?payment_hash=$(cat product_a_invoice.json |jq -r .payment_hash)

# follow the redirect to the contents
curl -L localhost:3000/products/a/download?payment_hash=$(cat product_a_invoice.json |jq -r .payment_hash)

About

Example of a downloads vending machine using Alby API for payments and Magalu Object API for objects hosting

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published