435 queryParams.append('offset', ((pagination.value.currentPage - 1) * pagination.value.limit).toString());
436
437 const response = await fetch('/getFeedback?' + queryParams.toString(), {
438 headers: {
439 'Authorization': getAuthHeader()
494 const createApp = async () => {
495 try {
496 const response = await fetch('/createApp', {
497 method: 'POST',
498 headers: {
531 const deleteApp = async (appId) => {
532 try {
533 const response = await fetch('/deleteApp?id=' + appId, {
534 method: 'DELETE',
535 headers: {
1/** @jsxImportSource npm:hono/jsx **/
2
3import { 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});
176
177export 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) {
62 const response = await fetch('https://username-submitFeedback.web.val.run', {
63 method: 'POST',
64 headers: {
88const submitFeedback = async (apiKey, rating, comment) => {
89 try {
90 const response = await fetch('https://username-submitFeedback.web.val.run', {
91 method: 'POST',
92 headers: {
11
12 useEffect(() => {
13 fetchComments();
14 // Check if Web Share API is supported
15 setIsShareSupported("share" in navigator);
16 }, []);
17
18 async function fetchComments() {
19 try {
20 const response = await fetch("/get-comments");
21 const data = await response.json();
22 setComments(data);
23 } catch (error) {
24 console.error("Failed to fetch comments", error);
25 }
26 }
31
32 try {
33 const response = await fetch("/submit-comment", {
34 method: "POST",
35 headers: { "Content-Type": "application/json" },
38
39 if (response.ok) {
40 fetchComments();
41
42 // Prepare email content
213 }
214
215 // Fetch comments
216 if (request.method === "GET" && new URL(request.url).pathname === "/get-comments") {
217 const result = await sqlite.execute(`
33app.get("/10gb", s(get10gb));
34
35export default app.fetch;
36
37function fromB64(str: string): Uint8Array {
15 const start = performance.now();
16 try {
17 res = await fetch(url);
18 end = performance.now();
19 status = res.status;
25 } catch (e) {
26 end = performance.now();
27 reason = `couldn't fetch: ${e}`;
28 ok = false;
29 }
48 },
49 vertexShader:`varying vec2 vUv; void main(){vUv=uv;gl_Position=vec4(position,1.);}`,
50 fragmentShader: await (await fetch('data:text/plain,'+encodeURIComponent(`
51/* WGSL-like GLSL fragment shader: traces one null geodesic per pixel */
52/* Kerr–Newman metric helpers ------------------------------------------- */
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
37
38 this.initializeDOM();
39 this.fetchExploredNeighborhoods();
40 }
41
102 }
103
104 async fetchExploredNeighborhoods() {
105 try {
106 const response = await fetch("/get-explored-neighborhoods");
107 const data = await response.json();
108 this.exploredNeighborhoods = data.explored;
109 this.updateUI();
110 } catch (error) {
111 console.error("Failed to fetch explored neighborhoods", error);
112 }
113 }
134 async toggleNeighborhood(neighborhoodName) {
135 try {
136 const response = await fetch("/toggle-neighborhood", {
137 method: "POST",
138 headers: { "Content-Type": "application/json" },
98 async function loadExploredNeighborhoods() {
99 try {
100 const response = await fetch(GET_ENDPOINT);
101 const data = await response.json();
102 knownNeighborhoods = data.neighborhoods || [];
120 };
121
122 await fetch(UPDATE_ENDPOINT, {
123 method: 'POST',
124 headers: {
239 try {
240 // Load Berlin neighborhood data
241 const response = await fetch('https://raw.githubusercontent.com/madisonwalker/berlin-neighbourhoods/main/berlin_neighbourhoods.geojson');
242 const data = await response.json();
243