13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:
16
17```ts
13must contain your board server API key.
14
15To use, create an HTTP val, then import the `proxy` function from this script and call it like this:
16
17```ts
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [SplineComponent, setSplineComponent] = useState(null);
7 const [error, setError] = useState(null);
50}
51
52function client() {
53 createRoot(document.getElementById("root")).render(<App />);
54}
56if (typeof document !== "undefined") { client(); }
57
58async function server(request: Request): Promise<Response> {
59 return new Response(
60 `
1/** @jsxImportSource npm:hono/jsx */
2async function createSession(email: string, hostname: string) {
3 const { zip } = await import("https://esm.town/v/pomdtr/sql");
4 const { sqlite } = await import("https://esm.town/v/std/sqlite");
23}
24
25async function getSession(sessionID: string, hostname: string) {
26 const { zip } = await import("https://esm.town/v/pomdtr/sql");
27 const { sqlite } = await import("https://esm.town/v/std/sqlite");
52}
53
54async function deleteSession(sessionID: string) {
55 const { sqlite } = await import("https://esm.town/v/std/sqlite");
56
64const OAUTH_COOKIE = "oauth_store";
65
66export function lastlogin(
67 handler: (req: Request) => Response | Promise<Response>,
68) {
107];
108
109function App() {
110 const [currentWord, setCurrentWord] = useState("");
111 const [options, setOptions] = useState([]);
177}
178
179function client() {
180 createRoot(document.getElementById("root")).render(<App />);
181}
185}
186
187export default async function server(request: Request): Promise<Response> {
188 return new Response(`
189 <html>
1export default async function server(request: Request): Promise<Response> {
2 const html = `
3 <html>
139 const status = document.getElementById('status');
140
141 function initAudio() {
142 audioContext = new (window.AudioContext || window.webkitAudioContext)();
143 oscillator = audioContext.createOscillator();
176 }
177
178 function togglePlay() {
179 if (!isPlaying) {
180 if (!audioContext) initAudio();
190 }
191
192 function panic() {
193 if (audioContext) {
194 oscillator.stop();
206 }
207
208 function updateAudio(event) {
209 if (!isPlaying) return;
210
222 }
223
224 function updateReverb() {
225 if (reverbNode) {
226 reverbNode.wet.value = parseFloat(reverbSlider.value);
228 }
229
230 function updateNoise() {
231 if (noiseNode) {
232 noiseNode.gain.setValueAtTime(parseFloat(noiseSlider.value), audioContext.currentTime);
2
3/**
4 * You can supply these options as a second argument to the `proxy` function.
5 * These options are used to configure the frontend.
6 */
146
147export const proxy = (url: string, options?: FrontendOptions) => {
148 return async function(req: Request): Promise<Response> {
149 if (req.method === "OPTIONS") {
150 return new Response("ok", { headers: structuredClone(CORS_HEADERS) });
65}
66
67export default async function (req: Request): Promise<Response> {
68 const schema: Schema = {
69 components: {
379
380 for (i = 0; i < coll.length; i++) {
381 coll[i].addEventListener("click", function() {
382 this.classList.toggle("active");
383 var content = this.nextElementSibling;
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5// Utility function to generate a unique 16-character ID
6function generateUniqueID() {
7 return Math.random().toString(36).substring(2, 10)
8 + Math.random().toString(36).substring(2, 10);
9}
10
11function Proposition({ prop, userChoice, onChoiceChange }) {
12 return (
13 <div className="border-t-2 md:border-2 border-black bg-white sm:rounded-md p-6 relative">
45}
46
47function App() {
48 const [stateProps, setStateProps] = useState([]);
49 const [userChoices, setUserChoices] = useState({});
61
62 // Load props data from API
63 async function loadProps() {
64 const statePropsData = await fetch("/api/state-props").then(res => res.json());
65 setStateProps(statePropsData);
71 useEffect(() => {
72 // Load user choices from server
73 async function loadUserChoices() {
74 const choices = await fetch(`/api/user-choices?id=${userID}`).then(res => res.json());
75 setUserChoices(choices);
155}
156
157function client() {
158 createRoot(document.getElementById("root")).render(<App />);
159}
161if (typeof document !== "undefined") { client(); }
162
163export default async function server(request: Request): Promise<Response> {
164 const { blob } = await import("https://esm.town/v/std/blob");
165
3import { createRoot } from "https://esm.sh/react-dom/client";
4
5function App() {
6 const [question, setQuestion] = useState("");
7 const [answer, setAnswer] = useState("");
72}
73
74function client() {
75 createRoot(document.getElementById("root")).render(<App />);
76}
78if (typeof document !== "undefined") { client(); }
79
80export default async function server(request: Request): Promise<Response> {
81 return new Response(`
82 <html>
A helper function to build a file's email
Simple functional CSS library for Val Town
import { OpenAI } from "https://esm.town/v/std/openai";
export default async function(req: Request): Promise<Response> {
if (req.method === "OPTIONS") {
return new Response(null, {
headers: {
"Access-Control-Allow-Origin": "*",
LangChain (https://langchain.com) Ambassador, KubeSphere (https://kubesphere.io) Ambassador, CNCF OpenFunction (https://openfunction.dev) TOC Member.