22 });
23
24const fetch = jitc(app);
25console.log(fetch.toString());
26
27export default fetch;
11 if (!websiteUrl) return;
12
13 const response = await fetch("/generate-embed", {
14 method: "POST",
15 headers: { "Content-Type": "application/json" },
25
26 useEffect(() => {
27 const fetchVisitorCount = async () => {
28 if (websiteUrl) {
29 const response = await fetch(`/visitor-count?url=${encodeURIComponent(websiteUrl)}`);
30 if (response.ok) {
31 const { count } = await response.json();
35 };
36
37 fetchVisitorCount();
38 const interval = setInterval(fetchVisitorCount, 5000);
39 return () => clearInterval(interval);
40 }, [websiteUrl]);
96
97 useEffect(() => {
98 const fetchCount = async () => {
99 const response = await fetch('${url.origin}/count-visitor?url=${encodedUrl}');
100 if (response.ok) {
101 const { count } = await response.json();
104 };
105
106 fetchCount();
107 }, []);
108
35
36async function execute(statement: InStatement, args?: InArgs): Promise<ResultSet> {
37 const res = await fetch(`${API_URL}/v1/sqlite/execute`, {
38 method: "POST",
39 headers: {
50
51async function batch(statements: InStatement[], mode?: TransactionMode): Promise<ResultSet[]> {
52 const res = await fetch(`${API_URL}/v1/sqlite/batch`, {
53 method: "POST",
54 headers: {
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
17 expect(upload_route).toBeTruthy();
18 expect(passwordAuth).toBeTruthy();
19 expect(modifyFetchHandler).toBeTruthy();
20});
21
27 expect(upload_route).toBeTruthy();
28 expect(passwordAuth).toBeTruthy();
29 expect(modifyFetchHandler).toBeTruthy();
30});
31
37 expect(await upload_route({})).toBeTruthy();
38 expect(await passwordAuth({})).toBeTruthy();
39 expect(await modifyFetchHandler({})).toBeTruthy();
40};
41
168});
169
170export default modifyFetchHandler(passwordAuth(app.fetch));
1/** @jsxImportSource https://esm.sh/hono@4.0.8/jsx **/
2
3import { modifyFetchHandler } from "https://esm.town/v/andreterron/codeOnValTown?v=50";
4import view_route from "https://esm.town/v/pomdtr/blob_admin_blob";
5import create_route from "https://esm.town/v/pomdtr/blob_admin_create";
137});
138
139export default modifyFetchHandler(passwordAuth(app.fetch));
3
4// this causes timeouts for uploadfromfileurl
5// import { fetch } from "https://esm.town/v/std/fetch";
6
7export class Blobby {
135 url = 'https://' + url.replace(/^(http:\/\/)?/, '');
136 }
137 const response = await fetch(url);
138 const arrayBuffer = await response.arrayBuffer();
139 await blob.set(this.getKey(key), arrayBuffer);
1import { fetch } from "https://esm.town/v/std/fetch";
2
3export let arenaApiExample = (async () => {
4 const resp = await fetch(
5 "http://api.are.na/v2/channels/project-logs",
6 );
3Example of using the [are.na](https://dev.are.na/documentation/channels#Block43472) API to get the contents of an Are.na board - specifically my fun board that showcases websites with that "glossy black style."
4
5All you need is [fetch](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) to make this happen!
115 const body = await req.json() as { $key: string };
116 body.$key = $key;
117 const response = await fetch(endpointURL, {
118 method: "POST",
119 headers: {