Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

feat(docker): add deno-cache volume and use Deno.serve

Inder Singh97d9865ed4bf
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 11f952c7d64..70568224a1d 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -334,6 +334,7 @@ services:
restart: unless-stopped
volumes:
- ./volumes/functions:/home/deno/functions:Z
+ - deno-cache:/root/.cache/deno
depends_on:
analytics:
condition: service_healthy
@@ -543,3 +544,4 @@ services:
volumes:
db-config:
+ deno-cache:
diff --git a/docker/volumes/functions/hello/index.ts b/docker/volumes/functions/hello/index.ts
index f1e20b90e01..e3f138b5eca 100644
--- a/docker/volumes/functions/hello/index.ts
+++ b/docker/volumes/functions/hello/index.ts
@@ -2,9 +2,7 @@
// https://deno.land/manual/getting_started/setup_your_environment
// This enables autocomplete, go to definition, etc.
-import { serve } from "https://deno.land/[email protected]/http/server.ts"
-
-serve(async () => {
+Deno.serve(async () => {
return new Response(
`"Hello from Edge Functions!"`,
{ headers: { "Content-Type": "application/json" } },
diff --git a/docker/volumes/functions/main/index.ts b/docker/volumes/functions/main/index.ts
index a094010b9da..b593527d687 100644
--- a/docker/volumes/functions/main/index.ts
+++ b/docker/volumes/functions/main/index.ts
@@ -1,4 +1,3 @@
-import { serve } from 'https://deno.land/[email protected]/http/server.ts'
import * as jose from 'https://deno.land/x/[email protected]/index.ts'
console.log('main function started')
@@ -30,7 +29,7 @@ async function verifyJWT(jwt: string): Promise<boolean> {
return true
}
-serve(async (req: Request) => {
+Deno.serve(async (req: Request) => {
if (req.method !== 'OPTIONS' && VERIFY_JWT) {
try {
const token = getAuthToken(req)