From e4ed6d133dc016e9ecf3d7962afff605e9a366b4 Mon Sep 17 00:00:00 2001 From: Ollie Halliday <22655069+Hallidayo@users.noreply.github.com> Date: Mon, 28 Nov 2022 10:21:30 +0000 Subject: [PATCH 1/4] postgres link changed --- apps/docs/pages/guides/database.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/pages/guides/database.mdx b/apps/docs/pages/guides/database.mdx index d557ac7a79e..7efa2ad7513 100644 --- a/apps/docs/pages/guides/database.mdx +++ b/apps/docs/pages/guides/database.mdx @@ -85,7 +85,7 @@ Read about resetting your database password [here](/docs/guides/database/managin ## Next steps -- Read more about [Postgres](/docs/postgres/server/about) +- Read more about [Postgres](https://www.postgresql.org/about/) - Sign in: [app.supabase.com](https://app.supabase.com) export const Page = ({ children }) => From 9108f0ca7efbfac54f5d2a7ba1f1953d2f0676c7 Mon Sep 17 00:00:00 2001 From: Lakshan Perera Date: Tue, 29 Nov 2022 11:31:43 +1100 Subject: [PATCH 2/4] fix: improve oak server example to add routes --- .../supabase/functions/oak-server/index.ts | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/examples/edge-functions/supabase/functions/oak-server/index.ts b/examples/edge-functions/supabase/functions/oak-server/index.ts index c2891bd4e75..97bc7fdb169 100644 --- a/examples/edge-functions/supabase/functions/oak-server/index.ts +++ b/examples/edge-functions/supabase/functions/oak-server/index.ts @@ -1,13 +1,22 @@ -import { Application } from 'https://deno.land/x/oak/mod.ts' +import { Application, Router } from 'https://deno.land/x/oak/mod.ts' + +const router = new Router() +router + // Note: path will be prefixed with function name + .get('/oak-server', (context) => { + context.response.body = 'This is an example Oak server running on Edge Functions!' + }) + .post('/oak-server/greet', (context) => { + // Note: request body will be streamed to the function as chunks, set limit to 0 to fully read it. + const result = context.request.body({ type: 'json', limit: 0 }) + const body = await result.value + const name = body.name || 'you' + + context.response.body = { msg: `Hey ${name}!` } + }) const app = new Application() - -app.use(async (ctx) => { - const result = ctx.request.body({ type: 'json', limit: 0 }) - const body = await result.value - const name = body.name || 'you' - - ctx.response.body = { msg: `Hey ${name}!` } -}) +app.use(router.routes()) +app.use(router.allowedMethods()) await app.listen({ port: 8000 }) From 14d4b7564b0b32a32a74ef0789ba23d6df2caad7 Mon Sep 17 00:00:00 2001 From: 0xflotus <0xflotus@gmail.com> Date: Tue, 29 Nov 2022 01:43:38 +0100 Subject: [PATCH 3/4] docs: small typo errors --- ...1-22-flutter-authentication-and-authorization-with-rls.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/www/_blog/2022-11-22-flutter-authentication-and-authorization-with-rls.mdx b/apps/www/_blog/2022-11-22-flutter-authentication-and-authorization-with-rls.mdx index c76f1e18ffd..7183c9fb539 100644 --- a/apps/www/_blog/2022-11-22-flutter-authentication-and-authorization-with-rls.mdx +++ b/apps/www/_blog/2022-11-22-flutter-authentication-and-authorization-with-rls.mdx @@ -52,7 +52,7 @@ flutter_bloc: ^8.0.0 Since the app has evolved, we also need to update our table schema. In order to store rooms data, we will add a rooms table. We will also modify the messages table to add a foreign key constraint to the rooms table so that we can tell which message belongs to which room. -We will also intorudce a `create_new_room` function, which is a [database function](https://supabase.com/docs/guides/database/functions) that handles chat room creation. It knows to create a new room if a chat room with the two users does not exist yet, or to just return the room ID if it already exists. +We will also introduce a `create_new_room` function, which is a [database function](https://supabase.com/docs/guides/database/functions) that handles chat room creation. It knows to create a new room if a chat room with the two users does not exist yet, or to just return the room ID if it already exists. ```sql -- *** Table definitions *** @@ -1154,7 +1154,7 @@ import 'package:my_chat_app/pages/rooms_page.dart'; import 'package:my_chat_app/utils/constants.dart'; import 'package:supabase_flutter/supabase_flutter.dart'; -/// Page to redirect users to the appropreate page depending on the initial auth state +/// Page to redirect users to the appropriate page depending on the initial auth state class SplashPage extends StatefulWidget { const SplashPage({Key? key}) : super(key: key); From 7df6ad35ceb7fc42a6bcd5b9f9121d12db63725c Mon Sep 17 00:00:00 2001 From: Lakshan Perera Date: Tue, 29 Nov 2022 17:01:21 +1100 Subject: [PATCH 4/4] added an endpoint for showing how to redirect --- examples/edge-functions/supabase/functions/oak-server/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/edge-functions/supabase/functions/oak-server/index.ts b/examples/edge-functions/supabase/functions/oak-server/index.ts index 97bc7fdb169..8e96d1f0033 100644 --- a/examples/edge-functions/supabase/functions/oak-server/index.ts +++ b/examples/edge-functions/supabase/functions/oak-server/index.ts @@ -14,6 +14,9 @@ router context.response.body = { msg: `Hey ${name}!` } }) + .get('/oak-server/redirect', (context) => { + context.response.redirect('https://www.example.com') + }) const app = new Application() app.use(router.routes())