origami
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: v54View latest version
This Val is reset to a clean backend-first architecture:
- The backend generates and stores the latest origami artifact.
- The frontend is a minimal React UI that renders that artifact.
- A cron job writes a new artifact each hour.
backend/ auth.ts index.http.ts origami.ts storage.ts frontend/ index.html app.js jobs/ generate-origami.cron.ts shared/ types.ts
-
GET /- Serves the React page.
- Injects
window.__INITIAL_DATA__from backend storage/generation. - Supports
?force=1for unprotected manual regeneration.
-
GET /api/origami/latest- Returns the latest artifact JSON.
- Supports
?force=1for unprotected manual regeneration.
-
POST /api/origami/generate- Token-protected by
x-origami-token. - Optional JSON body:
{ "force": true }.
- Token-protected by
- Uses Rabbit Ear as the source of square geometry.
- Applies exactly two arbitrary crease+fold steps.
- Black linework only.
- Front/back paper colors are regenerated from the seed.
- Stores latest-only at blob key
origami_latest_v1.
- Cron file:
jobs/generate-origami.cron.ts - Intended schedule: once per hour.
ORIGAMI_GENERATE_TOKENforPOST /api/origami/generate