Skip to content

Commit

Permalink
chore: add docs/example app
Browse files Browse the repository at this point in the history
  • Loading branch information
Ehesp committed Apr 4, 2023
1 parent 948aa07 commit 09b2998
Show file tree
Hide file tree
Showing 13 changed files with 537 additions and 14 deletions.
3 changes: 2 additions & 1 deletion bricks/supabase_functions/__brick__/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.dart_tool
.dart_tool
supabase/functions/dart_edge
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
["Request Properties", "/platform/cloudflare/request-properties"],
["Service Bindings", "/platform/cloudflare/service-bindings"]
]
]
],
["Supabase Edge Functions", [["Getting Started", "/platform/supabase"]]]
]
}
2 changes: 2 additions & 0 deletions docs/platform/supabase/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ supabase functions serve dart_edge --no-verify-jwt

> Note: By default Supabase Functions expects a valid auth header. The `--no-verify-jwt` enables you to run the function without a valid auth header.
You should now be able to access your function at [http://localhost:54321/functions/v1/dart_edge](http://localhost:54321/functions/v1/dart_edge).

To learn more about local Supabase development, view their [documentation](https://supabase.com/docs/guides/functions/local-development).

## Deployment
Expand Down
2 changes: 2 additions & 0 deletions examples/supabase-edge-functions/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.dart_tool
supabase/functions/dart_edge
21 changes: 21 additions & 0 deletions examples/supabase-edge-functions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Supabase Edge Functions Example

This template demonstrates how to run a [Supabase Edge Functions](https://supabase.com/docs/guides/functions) application via Dart Edge.

## Getting Started

Install the dependencies:

```bash
dart pub get
```

Start the application via Dart Edge CLU & the [`supabase` CLI](https://supabase.com/docs/guides/cli):

```bash
supabase init
edge build supabase_functions --dev
supabase functions serve dart_edge --no-verify-jwt
```

For more information, see the [Dart Edge documentation](https://docs.dartedge.dev).
24 changes: 24 additions & 0 deletions examples/supabase-edge-functions/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
7 changes: 7 additions & 0 deletions examples/supabase-edge-functions/lib/main.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import 'package:supabase_functions/supabase_functions.dart';

void main() {
SupabaseFunctions(fetch: (request) {
return Response("Hello from Supabase Edge Functions!");
});
}
Loading

0 comments on commit 09b2998

Please sign in to comment.