2
3todo:
4- fetch and persist data on regular basis
5- display data from cache
6
25There are two endpoints:
26
27- `/` -- the root endpoint fetches all flags for the given user.
28- `/:id` -- fetches just one flag value, given by `:id`, for the given user.
29
30## Specifying users
112});
113
114export default app.fetch;
1# Framer Fetch: Basic
2
3A basic example of an API endpoint to use with Framer Fetch.
4
5 try {
6 // Fetch the data from the Google Script URL
7 const response = await fetch(url);
8 const jsonData = await response.json();
9
30 });
31 } catch (error) {
32 return new Response("Failed to fetch data", { status: 500 });
33 }
34}
4
5 try {
6 // Fetch the data from the Google Script URL
7 const response = await fetch(url);
8 const jsonData = await response.json();
9
38 });
39 } catch (error) {
40 return new Response("Failed to fetch data", { status: 500 });
41 }
42}
555 module: mod,
556 bytes: buffer,
557 } = (url = fetch(url), void 0, await QN(await url, mod)),
558 assignWasm(url),
559 buffer);
610const getMeta = async (url: string) => {
611 console.log(url);
612 let resp = await fetch(url, {
613 "headers": {
614 "UserAgent": user_agent,
629 let getSourcesUrl = "https://rabbitstream.net/ajax/v2/embed-4/getSources?id=" + xrax + "&v="
630 + fake_window.localStorage.kversion + "&h=" + fake_window.localStorage.kid + "&b=1676800512";
631 let resp_json = await (await fetch(getSourcesUrl, {
632 "headers": {
633 "User-Agent": user_agent,
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(location: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${location}?format=j1`);
5}
6
1const jsonData = await (await fetch("https://tempdev-brilliantbronzevicuna.web.val.run/")).text();
2
3// Create a FormData object
13const apiUrl = "https://filehaus.top/api/upload/data.ts"; // Replace with your API URL
14
15// Send the file using fetch
16try {
17 const response = await fetch(apiUrl, {
18 method: "POST",
19 body: formData,
31});
32
33export default luciaMiddleware(app.fetch);