VtStressTestProject.cursorrules5 matches
163```
1641655. **fetchTranspiledJavaScript** - Fetch and transpile TypeScript to JavaScript:
166```ts
167const jsCode = await fetchTranspiledJavaScript("https://esm.town/v/username/project/path/to/file.ts");
168```
169242243// Inject data to avoid extra round-trips
244const initialData = await fetchInitialData();
245const dataScript = `<script>
246window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
3003015. **API Design:**
302- `fetch` handler is the entry point for HTTP vals
303- Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
304- Properly handle CORS if needed for external access
VtStressTestProjectApp.tsx17 matches
82const [cookieAndTeaMode, setCookieAndTeaMode] = useState(false);
8384// Fetch images from backend instead of blob storage directly
85useEffect(() => {
86// Set default background color in case image doesn't load
89}
9091// Fetch avatar image
92fetch("/api/images/stevens.jpg")
93.then((response) => {
94if (response.ok) return response.blob();
103});
104105// Fetch wood background
106fetch("/api/images/wood.jpg")
107.then((response) => {
108if (response.ok) return response.blob();
129}, []);
130131const fetchMemories = useCallback(async () => {
132setLoading(true);
133setError(null);
134try {
135const response = await fetch(API_BASE);
136if (!response.ok) {
137throw new Error(`HTTP error! status: ${response.status}`);
154}
155} catch (e) {
156console.error("Failed to fetch memories:", e);
157setError(e.message || "Failed to fetch memories.");
158} finally {
159setLoading(false);
162163useEffect(() => {
164fetchMemories();
165}, [fetchMemories]);
166167const handleAddMemory = async (e: React.FormEvent) => {
176177try {
178const response = await fetch(API_BASE, {
179method: "POST",
180headers: { "Content-Type": "application/json" },
188setNewMemoryTags("");
189setShowAddForm(false);
190await fetchMemories();
191} catch (e) {
192console.error("Failed to add memory:", e);
199200try {
201const response = await fetch(`${API_BASE}/${id}`, {
202method: "DELETE",
203});
205throw new Error(`HTTP error! status: ${response.status}`);
206}
207await fetchMemories();
208} catch (e) {
209console.error("Failed to delete memory:", e);
231232try {
233const response = await fetch(`${API_BASE}/${editingMemory.id}`, {
234method: "PUT",
235headers: { "Content-Type": "application/json" },
240}
241setEditingMemory(null);
242await fetchMemories();
243} catch (e) {
244console.error("Failed to update memory:", e);
GRIB_requestermain.tsx4 matches
53headers.set("Accept-Language", "en-US,en;q=0.9");
54headers.set("Origin", "https://eur.explore.garmin.com");
55headers.set("Sec-Fetch-Dest", "empty");
56headers.set("Sec-Fetch-Mode", "cors");
57headers.set("Sec-Fetch-Site", "same-origin");
58headers.set("Priority", "u=0");
59headers.set("TE", "trailers");
71});
7273let result = fetch(request)
74.then(res => {
75console.log("Response from garmin:", res);
a82a1af3a21__remix_99102.cursorrules3 matches
239
240// Inject data to avoid extra round-trips
241const initialData = await fetchInitialData();
242const dataScript = `<script>
243window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
2862875. **API Design:**
288- `fetch` handler is the entry point for HTTP vals
289- Run the Hono app with `export default app.fetch // This is the entry point for HTTP vals`
290291
maine-bills-taxsearch.ts2 matches
1import { SearchResult } from "https://esm.town/v/cmknz/maine-bills-tax/types.ts";
2import { fetchText } from "https://esm.town/v/stevekrouse/fetchText?v=6";
34// Inject the search term in to the URL
9// Query the Maine bill database
10export function search(term: string): Promise<SearchResult[]> {
11return fetchText(getSearchURL(term)).then((res) => {
12return JSON.parse(res).hits.hits;
13}) as Promise<SearchResult[]>;
productpaneldashboard.http.ts3 matches
435queryParams.append('offset', ((pagination.value.currentPage - 1) * pagination.value.limit).toString());
436
437const response = await fetch('/getFeedback?' + queryParams.toString(), {
438headers: {
439'Authorization': getAuthHeader()
494const createApp = async () => {
495try {
496const response = await fetch('/createApp', {
497method: 'POST',
498headers: {
531const deleteApp = async (appId) => {
532try {
533const response = await fetch('/deleteApp?id=' + appId, {
534method: 'DELETE',
535headers: {
sqliteExplorerAppmain.tsx4 matches
1/** @jsxImportSource npm:hono/jsx **/
23import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import { iframeHandler } from "https://esm.town/v/nbbaier/iframeHandler";
5import { resetStyle } from "https://esm.town/v/nbbaier/resetStyle";
16import { verifyToken } from "https://esm.town/v/pomdtr/verifyToken";
17import { ResultSet, sqlite } from "https://esm.town/v/std/sqlite";
18import { reloadOnSaveFetchMiddleware } from "https://esm.town/v/stevekrouse/reloadOnSave";
19import { Hono } from "npm:hono";
20import type { FC } from "npm:hono/jsx";
175});
176177export const handler = app.fetch;
178export default iframeHandler(modifyFetchHandler(passwordAuth(handler, { verifyPassword: verifyToken })));
60// Example client-side code for submitting feedback
61async function submitFeedback(rating, comment) {
62const response = await fetch('https://username-submitFeedback.web.val.run', {
63method: 'POST',
64headers: {
88const submitFeedback = async (apiKey, rating, comment) => {
89try {
90const response = await fetch('https://username-submitFeedback.web.val.run', {
91method: 'POST',
92headers: {
33app.get("/10gb", s(get10gb));
3435export default app.fetch;
3637function fromB64(str: string): Uint8Array {