Blame view

泰额版/Food Labeling Management Platform/src/supabase/functions/server/index.tsx 632 Bytes
884054fb   “wangming”   项目初始化
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  import { Hono } from "npm:hono";
  import { cors } from "npm:hono/cors";
  import { logger } from "npm:hono/logger";
  import * as kv from "./kv_store.tsx";
  const app = new Hono();
  
  // Enable logger
  app.use('*', logger(console.log));
  
  // Enable CORS for all routes and methods
  app.use(
    "/*",
    cors({
      origin: "*",
      allowHeaders: ["Content-Type", "Authorization"],
      allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
      exposeHeaders: ["Content-Length"],
      maxAge: 600,
    }),
  );
  
  // Health check endpoint
  app.get("/make-server-5c9b8bc3/health", (c) => {
    return c.json({ status: "ok" });
  });
  
  Deno.serve(app.fetch);