Edge Functions

Run JavaScript or TypeScript on the server, triggered via HTTP endpoints. Functions execute in a Deno or Node.js subprocess with on-demand startup.

Create an Edge Function

CREATE EDGE FUNCTION hello
RUNTIME 'deno'
ENTRYPOINT 'functions/hello.ts'

Function File

// functions/hello.ts
Deno.serve((req: Request) => {
  const url = new URL(req.url);
  const name = url.searchParams.get("name") ?? "World";
  return new Response(
    JSON.stringify({ message: `Hello, ${name}!` }),
    { headers: { "Content-Type": "application/json" } }
  );
});

Invoke

curl http://localhost:7474/edge/hello?name=Alice
# {"message": "Hello, Alice!"}

Management

-- List all edge functions
SHOW EDGE FUNCTIONS

-- Drop an edge function
DROP EDGE FUNCTION hello

Runtimes

RuntimeCommandNotes
denodeno run --allow-netRecommended; secure by default
nodenodeRequires Node.js on PATH