202app.get('/favicon.svg', serve(favicon, 'image/svg+xml'));
203
204export default app.fetch;
248
249 try {
250 const response = await fetch('/chat', {
251 method: 'POST',
252 headers: {
312});
313
314export default app.fetch;
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),
14
15 try {
16 const response = await fetch("/summarize", {
17 method: "POST",
18 body: JSON.stringify({ url }),
100 const { url } = await request.json();
101
102 // Fetch webpage content
103 const webpageResponse = await fetch(url);
104 const webpageText = await webpageResponse.text();
105
1import { email } from "https://esm.town/v/std/email?v=9";
2
3// Fetches a random joke.
4async function fetchRandomJoke() {
5 const response = await fetch(
6 "https://official-joke-api.appspot.com/random_joke",
7 );
9}
10
11const randomJoke = await fetchRandomJoke();
12const setup = randomJoke.setup;
13const punchline = randomJoke.punchline;
1import { email } from "https://esm.town/v/std/email";
2import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON";
3
4export async function dailyDadJoke() {
5 let { setup, punchline } = await fetchJSON("https://official-joke-api.appspot.com/random_joke");
6 return email({
7 text: punchline,
23
24 try {
25 const response = await fetch("/", {
26 method: "POST",
27 body: JSON.stringify({ prompt, currentCode: code }),
167
168 try {
169 const response = await fetch('/submit-attendance', {
170 method: 'POST',
171 headers: {
373 const selectedDate = url.searchParams.get('date') || new Date().toISOString().split('T')[0];
374
375 // Fetch attendance records for the selected date
376 const attendanceRecords = await sqlite.execute(`
377 SELECT * FROM ${KEY}_attendance
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: {
358 }
359
360 const analysisResponse = await fetch('/analyse', {
361 method: 'POST',
362 headers: {
504
505export default async function(request: Request): Promise<Response> {
506 return app.fetch(request);
507}