13
14async function execute(statement: InStatement): Promise<ResultSet> {
15 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
16 method: "POST",
17 headers: {
27
28async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
29 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
30 method: "POST",
31 headers: {
1a super simple JSON setter/getter using valtown blobs. use GET to fetch it, use POST to set it. expects the inbound data to be JSON for simplicity. use `?key=foobar` to specify different storage locations.
2
3set:
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
2
3export const gsheet_call = async (service_account, sheet_id, method, action, data) => {
9 };
10 const token = await getToken(service_account, googleAuthOptions);
11 const result = fetchJSON(
12 `https://sheets.googleapis.com/v4/spreadsheets/${sheet_id}/${action}`,
13 {
5app.get("/", (c) => c.text("Hello world!"));
6app.get("/edit", (c) => editRedirect());
7export default app.fetch;
12app.get("/", (c) => c.text("Hello world!"));
13app.get("/edit", (c) => editRedirect());
14export default app.fetch;
15```
16
9app.get("/", async (c) => c.html(await sqlite_admin_tables()));
10app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
11export default basicAuth(app.fetch);
9app.get("/", async (c) => c.html(await sqlite_admin_tables()));
10app.get("/:table", async (c) => c.html(await sqlite_admin_table(c.req.param("table"))));
11export default basicAuth(app.fetch);
1import { email } from "https://esm.town/v/std/email?v=9";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3import { nominatimSearch } from "https://esm.town/v/stevekrouse/nominatimSearch";
4import { weatherGovGrid } from "https://esm.town/v/stevekrouse/weatherGovGrid";
14 lon,
15 });
16 let { properties: { periods } } = await fetchJSON(
17 grid.forecastHourly,
18 );
1import { GITHUB_EMOJIS } from "https://esm.town/v/karfau/GITHUB_EMOJIS";
2import { fetch } from "https://esm.town/v/std/fetch?v=4";
3
4export const isEmoji = (key: string) => Object.hasOwn(GITHUB_EMOJIS, key);
23 }
24 try {
25 return fetch(url);
26 } catch (error) {
27 console.error(req.url, nameFromURL, error);
1import { fetchNftMetadata } from "https://esm.town/v/jamiedubs/nftMetadata";
2
3export const nftImage = async (req: Request) => {
7 const format = searchParams.get("format")?.toLowerCase() ?? "text";
8 console.log("nftImage", { contractAddress, tokenId });
9 const json = await fetchNftMetadata(contractAddress, tokenId);
10 console.log("nftMetadata response =>", json);
11 const imageUrl = json["metadata"] && json["metadata"]["image"];