31function getAuthorizedPoints() {
32 console.log("Début getAuthorizedPoints - authorizedVehicles:", authorizedVehicles);
33 fetch("https://xnyx-ex15-ndvx.n7.xano.io/api:_aqWQ_f_/cached_mapCompanies", {
34 method: "POST",
35 headers: {
76 const fontPromises = fontsConfig.map(async (font) => {
77 const fontUrl = 'https://cdn.jsdelivr.net/npm/@tamagui/font-inter@1.108.3/otf/' + font.fontFile
78 const fontArrayBuf = await fetch(fontUrl).then((res) => res.arrayBuffer())
79 return { name: font.name, data: fontArrayBuf, weight: font.weight }
80 })
87 // const api = `https://cdnjs.cloudflare.com/ajax/libs/twemoji/14.0.2/svg/${code.toLowerCase()}.svg`
88 const api = `https://cdn.jsdelivr.net/gh/shuding/fluentui-emoji-unicode/assets/${code.toLowerCase()}_color.svg`
89 return fetch(api).then((r) => r.text())
90}
91
7 console.log("click: ", JSON.stringify(clickData));
8
9 fetch("/api/action", {
10 method: "POST",
11 headers: {
17 let html = await readFile("/frontend/index.html", import.meta.url);
18
19 const response = await fetch(`/api/demo/${id}`);
20 const initialData = await response.json();
21
87// Client-side event recording
88window.recordClick = function (action) {
89 fetch(`/api/setAction`, {
90 method: "POST",
91 headers: { "Content-Type": "application/json" },
7 const pinger = setInterval(async () => {
8 // check the boolean to see if a Glancer has enabled the link to start a cobrowsing session
9 const resp = await fetch("/api/cobrowse/" + window.__DEMO_ID__, {
10 method: "GET",
11 headers: {
60 }
61
62 // If no initial data, fetch it from the API
63 const demoId = window.__DEMO_ID__ || getDemoIdFromPath();
64 if (demoId && demoId !== 'demo') {
65 try {
66 const response = await fetch(`/api/demo/${demoId}`);
67 const data = await response.json();
68 return {
44});
45
46export default app.fetch;
47
30 // const apiUrl = new URL(c.req.url);
31 // apiUrl.pathname = `/api/demo/${id}`;
32 // const response = await fetch(apiUrl.toString());
33 const page = await getPage(id);
34
239
240 // Inject data to avoid extra round-trips
241 const initialData = await fetchInitialData();
242 const dataScript = `<script>
243 window.__INITIAL_DATA__ = ${JSON.stringify(initialData)};
286
2875. **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`
290
291
11
12 constructor() {}
13 async fetch(req: Request): Promise<Response> {
14 if (new URL(req.url).pathname === "/robots.txt") {
15 return new Response("User-agent: *\nDisallow: /");
250const sc = new StaticChess();
251
252export default analyticsHandlerWrapper(sc.fetch.bind(sc));
253