Deno Deploy --cert flag

242 views Asked by At

How can I add --cert flag when my project run on deno deploy?

I am using deno fresh and supabase postgres. When in local environment I use --cert flag to set certificate, but in deno deploy I didn't know how to set --cert flag

1

There are 1 answers

0
joel.d On

I don't believe there is an easy way to use --cert on Deno Deploy.

But if what you're trying to figure out how to connect to a Postgresql database (i.e. Supabase) and use a connection string (i.e. how they tell you to connect to their Supavisor connection pooler thing), you can actually just translate that into separate options (PGHOST, PGDATABASE, etc.), and then your Deno Postgresql client can be initialized with:

return new Client({ host_type: 'tcp', tls: { enabled: true, caCertificates: [supabaseCert], }, }); // Uses standard PostgreSQL env varies i.e. PGHOST, PGUSER, etc