in a deno environment you will have to use esmodul...
# help
g
in a deno environment you will have to use esmodules instead
n
Hello @Gui BL! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
Also be careful to not execute long running functions in there as they can timeout on their own
m
yup this seems to work:
Copy code
import { serve } from "https://deno.land/std@0.131.0/http/server.ts"
import md5 from 'https://cdn.skypack.dev/md5';

console.log("Hello from Functions!")

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

  return new Response(
    JSON.stringify(data),
    { headers: { "Content-Type": "application/json" } },
  )
})
n
Gui BL (2022-04-01)