1
2
3
4
5
6
7
8
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
// accessible via API at https://api.val.town/eval/@stevekrouse.basicAPIEx
export const basicAPIEx = fetchJSON(
"https://date.nager.at/api/v2/publicholidays/2023/US"
);
// Bonus: the whole runtime is available in the URL Bar 🤯
// ie https://api.val.town/eval/"The first holiday is "+ @stevekrouse.basicAPIEx[0].name
👆 This is a val. Vals are TypeScript snippets of code, written in the browser and run on our servers. Create scheduled functions, email yourself, and persist small pieces of data — all from the browser.