Edit on val.town ↗

Get an email alert when your website goes down

The usual answer is to sign up for an uptime monitoring service. On Val Town it's one cron-triggered val: fetch your URL on a schedule, remember the last known status in blob storage, and send yourself an email with std/email only when the status changes — one email when the site goes down, one when it recovers.

Because the last status is stored in blob storage, you never get repeat alerts while the site stays down. The first run only records a baseline, so remixing it never sends a surprise email.

  1. Remix this template — click the Remix button in the top right corner.
  2. In monitor.ts, change URL_TO_MONITOR to your website's URL.

That's it: no API keys, no environment variables, no signup for a monitoring service. To test it, point URL_TO_MONITOR at a URL that 404s and click Run on monitor.ts twice — the first run records the baseline, the second one emails you.

Last updated