Cannot POST error on hello world edge function

Hello all,
I created the most basic edge function using
supabase functions new hello-world
and deployed it to my project. I can see it in the project dashboard. But when I try to invoke it using the provided CLI command, I get this:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /functions/v1/hello-world</pre>
</body>
</html>

The body of the function is simply:
import { serve } from "https://deno.land/std@0.168.0/http/server.ts"

console.log("Hello from Functions!")

Deno.serve(async (req) => {
  const { name } = await req.json()
  const data = {
    message: `Hello ${name}!`,
  }

  return new Response(
    JSON.stringify(data),
    { headers: { "Content-Type": "application/json" } },
  )
})


Can't figure out what I'm doing wrong with this very simple example, can anyone help? Thanks!
Was this page helpful?