25 }
26
27 const response = await fetch(`/fork?url=${encodeURIComponent(projectUrl)}`, {
28 method: "POST",
29 headers: {
142 console.log(`URL: ${url}`);
143
144 const response = await fetch(url, {
145 headers: {
146 "Authorization": `Bearer ${SOCIAL_DATA_API_KEY}`,
206 console.log(`Making request to socialdata API with query: ${query}`, url);
207
208 const response = await fetch(url, {
209 headers: {
210 "Authorization": `Bearer ${SOCIAL_DATA_API_KEY}`,
254 }));
255 } catch (error) {
256 console.error(`Error fetching tweets for ${username}:`, error);
257 return [];
258 }
21});
22
23// HTTP vals expect an exported "fetch handler"
24// This is how you "run the server" in Val Town with Hono
25export default app.fetch;
28
29 try {
30 const response = await fetch(import.meta.url, {
31 method: "POST",
32 body: JSON.stringify({
185 }
186
187 const response = await fetch("https://api.mistral.ai/v1/chat/completions", {
188 method: "POST",
189 headers: {
210 }));
211
212 const response = await fetch("http://127.0.0.1:11434/api/chat", {
213 method: "POST",
214 headers: {
43});
44
45// HTTP vals expect an exported "fetch handler"
46// This is how you "run the server" in Val Town with Hono
47export default app.fetch;
39 try {
40 setLoading(true);
41 const response = await fetch("/generate-image", {
42 method: "POST",
43 headers: {
226 uploadButton.disabled = true;
227 uploadButton.textContent = "Uploading...";
228 const response = await fetch("https://todepond-spagUpload.web.val.run", {
229 method: "POST",
230 body,
246 );
247
248 async function fetchUploads() {
249 const response = await fetch("https://todepond-spagList.web.val.run");
250 const data = await response.json();
251 return data.rows;
256 previewAllButton.hidden = true;
257 refreshButton.textContent = "Refreshing...";
258 const uploads = await fetchUploads();
259 renderUploads(uploads);
260 refreshButton.textContent = "Refresh";
306 previewContainer.innerHTML = "";
307 try {
308 fetch(`https://spag.cc/${upload.name}`).then(async (response) => {
309 if (!response.ok) {
310 const textElement = document.createElement("p");
390 deleteButton.disabled = true;
391 deleteButton.textContent = "Deleting...";
392 const response = await fetch(
393 `https://todepond-spagDelete.web.val.run`,
394 {
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
3export default async function (interval: Interval) {
4 try {
5 const response = await fetch("https://seths.blog/feed/");
6 const feedText = await response.text();
7
22 });
23 } catch (error) {
24 console.error("Error fetching or processing feed:", error);
25 }
26}
5async function servePublicFile(path: string): Promise<Response> {
6 const url = new URL("./public/" + path, import.meta.url);
7 const text = await (await fetch(url, {
8 headers: {
9 "User-Agent": "", // to transpile TS to JS