105});
106
107export default app.fetch;
18});
19
20self.addEventListener('fetch', event => {
21 event.respondWith(
22 caches.match(event.request)
23 .then(response => {
24 return response || fetch(event.request);
25 })
26 );
63/**
64 * Wrap the incoming request, inject the Deno env vars into the Hono app,
65 * and then call the Hono api entrypoint (`app.fetch`)
66 */
67export default async function(req: Request): Promise<Response> {
74 //
75 // If you don't want those values, remove them from the env object
76 return app.fetch(req, env);
77}
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
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({
9 const app = await getApp();
10
11 return app.fetch(req);
12}
13
41 return { success: true, functions: rows.rows };
42 } catch (error) {
43 return { success: false, message: `Error fetching functions: ${Deno.inspect(error)}` };
44 }
45}
86 }
87 else if (req.method === "GET") {
88 // Check if we're fetching all functions or a specific path
89 if (url.pathname === "/functions") {
90 const functions = await getAllFunctions();
12 const app = await getApp();
13
14 return app.fetch(req);
15}
16
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
181
182 try {
183 const response = await fetch("/", {
184 method: "POST",
185 body: JSON.stringify({