# You're going to Val Town

[Canonical article](https://www.ashryan.io/writing/youre-going-to-val-town/)

Published: 2024-06-25

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](https://www.val.town/?ref=ashryan.io) 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](https://ashryanio-generateqrcode.web.val.run/?ref=ashryan.io) I cobbled together as a val:

[Open embedded Val Town content](https://www.val.town/embed/ashryanio/generateQrCode)

A few things to note here:

1. Those **imports** are a tour de force: 1. A Val Town standard library module (`blob`) 2. A user val imported as a module (`html`) 3. An npm module (`qrcode` imported as `npm:qrcode`)
2. A single val can handle **multiple request methods** via `req.method` 1. `GET` requests to my val receive HTML 2. 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)
3. Serverless functions use **standard request and response objects** 1. [`Request` docs on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Request?ref=ashryan.io) 2. [`Response` docs on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Response?ref=ashryan.io)

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](https://www.val.town/v/ashryanio/generateRandomSecret?ref=ashryan.io) I made. Goodbye, “keyboard cat”!

[Open embedded Val Town content](https://www.val.town/embed/ashryanio/generateRandomSecret)

Go ahead: [treat yourself to a 64-byte secret](https://ashryanio-generaterandomsecret.web.val.run/?length=64\&ref=ashryan.io). After all, you’re going to Val Town.
