andreterron avatar
rootValRef
@andreterron
Script
An interactive, runnable TypeScript val by andreterron
andreterron avatar
codeOnVT_modifyResponse
@andreterron
Script
"Code on Val Town" Response modifier Appends the "Code on Val Town" ribbon to an HTTP Response. Usage new modifyResponse(res, { handle: "andre", name: "foo" }) - define which val to link to; new modifyResponse(res) - infer the val from the call stack. Example: @andreterron/openable_res import { modifyResponse } from "https://esm.town/v/andreterron/codeOnVT_modifyResponse"; import { html } from "https://esm.town/v/stevekrouse/html?v=5"; export default async (req: Request): Promise<Response> => { return modifyResponse(html(` <h2>Hello world!</h2> <style>* { font-family: sans-serif }</style> `)); };
andreterron avatar
codeOnVT_ribbonElement
@andreterron
Script
"Code on Val Town" Ribbon HTML Element Ribbon element used by @andreterron/codeOnValTown Usage ribbonElement({val: { handle: "andre", name: "foo" }}) - define which val to link to; ribbonElement() - infer the val from the call stack. Example: @andreterron/openable_element import { ribbonElement } from "https://esm.town/v/andreterron/codeOnVT_ribbonElement?v=3"; import { html } from "https://esm.town/v/stevekrouse/html?v=5"; export default async (req: Request): Promise<Response> => { return html(` <h2>Hello world!</h2> <style>* { font-family: sans-serif }</style> ${ribbonElement()} `); };
andreterron avatar
ValRef
@andreterron
Script
An interactive, runnable TypeScript val by andreterron
andreterron avatar
inferRequestVal
@andreterron
Script
An interactive, runnable TypeScript val by andreterron
1
Next
July 23, 2024