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 }) => 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); diff --git a/examples/edge-functions/supabase/functions/oak-server/index.ts b/examples/edge-functions/supabase/functions/oak-server/index.ts index c2891bd4e75..8e96d1f0033 100644 --- a/examples/edge-functions/supabase/functions/oak-server/index.ts +++ b/examples/edge-functions/supabase/functions/oak-server/index.ts @@ -1,13 +1,25 @@ -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}!` } + }) + .get('/oak-server/redirect', (context) => { + context.response.redirect('https://www.example.com') + }) 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 })