This val now serves the whole website, not just the backend. index.html is
the real, live ordering site, and main.ts serves it (via Val Town's static
file helper) at the root URL while also handling POST /order, which emails
the order through Resend.
Why both live in one val: the site used to be a claude.ai
artifact that called this
backend from the browser. That doesn't work β a published Claude Artifact's
browser sandbox is locked down so it can only call its own origin
(connect-src 'self'), so it can never reach an external API no matter how
that API is configured. Serving the site from this same val makes the
fetch("/order") call same-origin, so there's nothing to block.
The real, live site is now: π https://zachary1--7fbcd9dcb2d011f1b1aa1607ee4eb77e.web.val.run
The claude.ai artifact link still exists as a design preview only β its "Place order" button can't send anything and will always show the "Couldn't send that automatically" fallback message. Use the val.town link above for actual testing and for sharing with anyone who should be able to place a real order.
RESEND_API_KEYβ a Resend API key. Already set and verified working. π Add RESEND_API_KEY here: https://www.val.town/x/zachary1/airsthaikitchen-order-backend/environment-variables?key=RESEND_API_KEY
ORDER_TO_EMAILβ the inbox that receives orders. Defaults tozacharyb1009@gmail.comwhile the site is in testing mode. π Add ORDER_TO_EMAIL here: https://www.val.town/x/zachary1/airsthaikitchen-order-backend/environment-variables?key=ORDER_TO_EMAILORDER_FROM_EMAILβ the "from" address Resend sends as. Defaults toonboarding@resend.dev, which works with zero domain setup as long asORDER_TO_EMAILis the same address the Resend account was signed up with. Sending to a different address (e.g. the restaurant's real inbox) needs a verified domain on Resend first. π Add ORDER_FROM_EMAIL here: https://www.val.town/x/zachary1/airsthaikitchen-order-backend/environment-variables?key=ORDER_FROM_EMAIL
index.htmlβ the full website (menu, basket, checkout). Edit this directly to change the site.main.tsβ routes/orderto the Resend email handler; everything else falls through to servingindex.htmland its assets.