(solved) Edge Function that sends an HTTP request

Hi All,
I am totally new to Supabase and I have a very basic/stupid question.
How can I send an HTTP (POST) request inside an Edge Function?
I have imported 'node-fetch' and wrote a very basic code, but when I try to either 'serve' or 'deploy' the function, it tells me that there is a problem with the way I am importing 'fetch'
Here is the code I have which even does not invoke the 'fetch'
import { serve } from "https://deno.land/std@0.131.0/http/server.ts";
import fetch  from "../../../node_modules/node-fetch";

console.log("Hello from Functions!")

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

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

Many thanks for your help
Was this page helpful?