You're going to Val Town
Val Town's runnable vals (their word for "gists") can be triggered manually, via email, or as an HTTP endpoint or cron job.
Val Town's tag line:
If GitHub Gists could run
And AWS Lambda was fun
Val Town's runnable vals (their word for "gists") can be triggered manually, via email, or as an HTTP endpoint or cron job.
I'm in. This is super fun.
QR code generator
Here's a little QR code generator I cobbled together as a val:
A few things to note here:
- Those imports are a tour de force:
- A Val Town standard library module (
blob
) - A user val imported as a module (
html
) - An npm module (
qrcode
imported asnpm:qrcode
)
- A Val Town standard library module (
- A single val can handle multiple request methods via
req.method
GET
requests to my val receive HTML- All other methods handle form data, then create and serve a QR code (if I wanted to be stricter, I could wrap this portion to check only for
POST
requests)
- Serverless functions use standard request and response objects
Sure, the world doesn't need another QR code generator, but imagine what you could do with these tools.
Secret generator
Here's a secret generator I made. Goodbye, "keyboard cat"!
Go ahead: treat yourself to a 64-byte secret. After all, you're going to Val Town.