devfest26-raffle
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v6View latest version
90s wacky postmodern raffle landing page with:
- Public entry form (
name+email) - Admin-only draw panel
- 3 prize slots with one unique winner each
devfest26-raffle/server.ts: Val Town-compatibleexport defaultrequest handler
deno run -A --watch devfest26-raffle/server.ts
Then open:
- Public page:
http://localhost:8000/ - Admin page:
http://localhost:8000/admin?key=change-me
Set an environment variable before running/deploying:
export ADMIN_KEY="your-secret-key"
- Use
devfest26-raffle/server.tsas your script entry. - Set
ADMIN_KEYin Val Town environment variables. - Visit
/admin?key=...to draw and announce winners.
- One entry per unique email
- Draw is random among entries that have not already won another prize
- Each prize can be drawn only once
