book-lookup-browserindex.ts1 match
218});
219220export default app.fetch;
my-todo-mcpmain.tsx1 match
29});
3031export default app.fetch;
book-lookup-browserindex.html3 matches
199200try {
201const response = await fetch('/api/search', {
202method: 'POST',
203headers: {
262263try {
264const response = await fetch('/api/search-isbn', {
265method: 'POST',
266headers: {
334}
335336const response = await fetch('/api/bulk-search', {
337method: 'POST',
338headers: {
hallwayEmbedPokemonindex.html4 matches
25
26async function main() {
27const count = await fetch("https://pokeapi.co/api/v2/pokemon")
28.then(res => res.json())
29.then(json => json.count)
30
31const fetchPokemon = async (index) => {
32const pokemon = await fetch(`https://pokeapi.co/api/v2/pokemon/${index}`)
33.then(res => res.json())
34
38btn.onclick = async () => {
39const index = randomIntFromInterval(1, 500)
40const pokemon = await fetchPokemon(index)
41
42sprite.src = pokemon.sprites.front_default
hallwayEmbedPokemonserver.ts1 match
11);
1213export default app.fetch;
helloStaticSitemain.ts2 matches
16});
1718// HTTP vals expect an exported "fetch handler"
19// This is how you "run the server" in Val Town with Hono
20export default app.fetch;
gemini-testmain.tsx1 match
7980try {
81const geminiResponse = await fetch(targetUrl, {
82method: req.method,
83headers: headersToGemini,
pinboardviewerindex.ts1 match
201<div class="bg-white p-8 rounded-lg shadow-md max-w-md">
202<h1 class="text-2xl font-bold text-red-600 mb-4">Error</h1>
203<p class="text-gray-600 mb-4">Failed to fetch data from the pins table.</p>
204<p class="text-sm text-gray-500">Error: ${escapeHtml(error.message)}</p>
205<a href="/"
untitled-2689main.tsx13 matches
604const triggerTelegramInteraction = async (chatId) => {
605try {
606const response = await fetch("/handle-telegram-interaction", {
607method: "POST",
608headers: { "Content-Type": "application/json" },
621};
622623const fetchUserBalance = async () => {
624let userId = null;
625let isTelegramEnv = false;
674if (userId) {
675try {
676const response = await fetch(`/get-balance?uid=${userId}`);
677if (!response.ok) {
678try {
699}
700} catch (error) {
701console.error("Failed to fetch or process balance:", error.toString());
702setBalance("Error");
703}
704} else {
705console.error("User ID could not be determined for balance fetching.");
706setBalance("--.--");
707}
727window.Telegram.WebApp.ready();
728}
729fetchUserBalance();
730} else if (isTelegramWebAppPresent) {
731console.log(
732"Telegram script present, but user data not immediately available or ready() pending. Setting timeout for balance fetch.",
733);
734if (window.Telegram.WebApp.ready) {
735window.Telegram.WebApp.ready();
736}
737scriptLoadTimeoutId = setTimeout(fetchUserBalance, 300);
738} else {
739console.log("Not in Telegram environment. Proceeding as web user for balance fetch.");
740fetchUserBalance();
741}
742}
878setShowSpinner(true);
879880const response = await fetch("/save-credentials", {
881method: "POST",
882headers: { "Content-Type": "application/json" },
1880const sendActualTelegramAPIMessage = async (botToken, chatId, text, parseMode = "Markdown") => {
1881try {
1882const response = await fetch(`https://api.telegram.org/bot${botToken}/sendMessage`, {
1883method: "POST",
1884headers: { "Content-Type": "application/json" },
2190if (confirm('Are you sure you want to unban this user?')) {
2191try {
2192const response = await fetch('/unban-telegram-user', {
2193method: 'POST',
2194headers: { 'Content-Type': 'application/json' },
proxiedfetchmain.tsx2 matches
1import { fetch as proxiedFetch } from "https://esm.town/v/std/fetch";
23export default async function (req: Request): Promise<Response> {
2829try {
30const upstream = await proxiedFetch(target, init);
31// Stream status, statusText, headers, and body back to the client
32return new Response(upstream.body, {