3const USERNAME = "yieldray"; // <--- Replace with your Github username
4
5const gistList: Array<Gist> = await fetch(`https://api.github.com/users/${USERNAME}/gists`).then((res) => res.json());
6
7app.get("/", (req) => {
42 const f = gist.files[file];
43 if (!f) return new Response("404 File Not Found", { status: 404 });
44 const res = await fetch(f.raw_url);
45 const headers = new Headers(res.headers);
46 // delete unwanted header
61});
62
63const handler = app.fetch
64export default handler
65
29 e.preventDefault();
30 setLoading(true);
31 const cron = await fetch("/compile", {
32 method: "POST",
33 body: new FormData(e.target as HTMLFormElement),
5
6const app = new Hono();
7export default app.fetch;
8app.get("/", (c) =>
9 c.html(
89 button.disabled = true;
90 button.innerText = "Loading..";
91 const cron = await fetch("/compile", { method: "POST", body: new FormData(form) }).then((r) => r.text());
92 button.disabled = false;
93 button.innerText = "Compile";
189 const formData = new FormData();
190 formData.append("audio", blob, "recording.wav");
191 const response = await fetch("/transcribe", { method: "POST", body: formData });
192 if (response.ok) {
193 const result = await response.text();
229 const language2Value = document.getElementById("language2").value;
230
231 const response = await fetch("/translate", {
232 method: "POST",
233 headers: { "Content-Type": "application/json" },
271
272 if (text && voice) {
273 const response = await fetch('/generate-speech', {
274 method: 'POST',
275 headers: { 'Content-Type': 'application/json' },
401
402
403export default app.fetch;
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
1import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
2
3export async function getWeather(city: string): Promise<WeatherResponse> {
4 return fetchJSON(`https://wttr.in/${city}?format=j1`);
5}
6
55 "embed",
56 "document",
57 ].includes(req.headers.get("sec-fetch-dest"))
58 )
59 return new Response(
16 const pathname = `/api/latest/user/${user}/workspace/${workspace}/query`;
17
18 const resp = await fetch(`${origin}${pathname}?sql=${encodeURIComponent(sql)}`, {
19 headers: {
20 Authorization: `Bearer ${Deno.env.get("PIPES_TOKEN")}`,
12
13 try {
14 const response = await fetch(url);
15 const data = await response.json();
16 return data;
111});
112
113export default app.fetch;