Merge branch 'master' into feat/lw6-landing

This commit is contained in:
Jonathan Summers-Muir committed 2022-11-29 17:59:39 +08:00
commit a74ca66d15
3 files changed
+24 -12

No files matched your search

+1 -1
View File
@@ -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 }) => <Layout meta={meta} children={children} />
@@ -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);
@@ -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 })