weekly-intentions
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.
index.ts
https://malcolmocean--a31b560a37fd11f08b979e149126039e.web.val.run
A simple API that returns daily schedule items based on the current day of the week.
schedule.yaml
- Contains the weekly schedule databackend/index.ts
- HTTP endpoint that serves the schedule
- The API reads the schedule from
schedule.yaml
- Determines the current day based on Pacific time
- If it's after 8pm Pacific, it uses tomorrow's schedule instead
- Returns the schedule items for that day as a multiline string (joined with
\n
)
Make a GET request to the endpoint to receive the current day's schedule.
Example response for Tuesday:
6) Gwen aft
MJ) call w Ivan
If there are no items for a day (like Sunday), it returns an empty string.