Skip to content

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

missing file

Jonathan Summers-Muir8cb0aee7403f
diff --git a/www/data/products/functions/usecase-examples.js b/www/data/products/functions/usecase-examples.js
new file mode 100644
index 00000000000..8cd511b036a
--- /dev/null
+++ b/www/data/products/functions/usecase-examples.js
@@ -0,0 +1,92 @@
+/*
+ * description
+ */
+export default [
+ {
+ lang: 'js',
+ title: 'Sending an email',
+ size: 'large',
+ code: `import { serve } from "https://deno.land/[email protected]/http/server.ts";
+import { SmtpClient } from "https://deno.land/x/[email protected]/mod.ts";
+const client = new SmtpClient();
+const { hostname, port, username, password } = Deno.env.toObject();
+
+await client.connect({
+ hostname,
+ port: Number(port),
+ username,
+ password,
+});
+
+serve(async (_req) => {
+ await client.send({
+ subject: "Notifications Ui has launched",
+ content: "And this is a notification about that",
+ });
+
+ return new Response("Email sent", { status: 200 });
+});`,
+ },
+ {
+ lang: 'js',
+ title: 'Connect to database directly',
+ size: 'large',
+ code: `import { serve } from "https://deno.land/[email protected]/http/server.ts";
+import * as postgres from "https://deno.land/x/[email protected]/mod.ts";
+
+const databaseUrl = Deno.env.get("DATABASE_URL") ?? "";
+const pool = new postgres.Pool(databaseUrl, 3, true);
+const connection = await pool.connect();
+
+serve(async (req: Request) => {
+ // sql inject your database
+ const { query } = await req.json();
+ const response = await connection.queryObject(query);
+ console.log(response);
+ return new Response("Query executed", { status: 200 });
+});`,
+ },
+ {
+ lang: 'js',
+ title: 'Read from storage',
+ size: 'large',
+ code: `import { serve } from "https://deno.land/[email protected]/http/server.ts";
+import { createClient } from "https://esm.sh/@supabase/[email protected]";
+
+serve(async (req) => {
+ const SUPABASE_URL = Deno.env.get("SUPABASE_URL") ?? "";
+ const SERVICE_KEY = Deno.env.get("SERVICE_KEY") ?? "";
+ const supabase = createClient(SUPABASE_URL, SERVICE_KEY);
+ if (req.headers.get("Authorization") === "super-secret-key") {
+ const { data } = await supabase.storage
+ .from("newbucket")
+ .download("supameme.png");
+ return new Response(data, { headers: { "content-type": "image/png" } });
+ } else {
+ return new Response("Forbidden", { status: 403 });
+ }
+});`,
+ },
+ {
+ lang: 'js',
+ title: 'Read from database',
+ size: 'large',
+ code: `import { serve } from "https://deno.land/[email protected]/http/server.ts";
+import { createClient } from "https://esm.sh/@supabase/[email protected]";
+
+serve(async () => {
+ const SUPABASE_URL = Deno.env.get("SUPABASE_URL") ?? "";
+ const SERVICE_KEY = Deno.env.get("SERVICE_KEY") ?? "";
+ const supabase = createClient(SUPABASE_URL, SERVICE_KEY);
+ const { data } = await supabase.from("todos").select();
+ return new Response(JSON.stringify(data), {
+ status: 200,
+ headers: {
+ "Content-Type": "application/json",
+ },
+ });
+});`,
+ },
+]
diff --git a/www/public/sitemap_www.xml b/www/public/sitemap_www.xml
index c0a61ded5ed..db4efd9f929 100644
--- a/www/public/sitemap_www.xml
+++ b/www/public/sitemap_www.xml
@@ -55,13 +55,13 @@
</url>
<url>
- <loc>https://supabase.com/database</loc>
+ <loc>https://supabase.com/edge-functions/edge-functions</loc>
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
<url>
- <loc>https://supabase.com/storage</loc>
+ <loc>https://supabase.com/database</loc>
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
@@ -72,6 +72,12 @@
<changefreq>0.5</changefreq>
</url>
+ <url>
+ <loc>https://supabase.com/storage</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
<url>
<loc>https://supabase.com/blog/2020/05/01/supabase-alpha-april-2020</loc>
<changefreq>weekly</changefreq>
@@ -589,4 +595,22 @@
<changefreq>weekly</changefreq>
<changefreq>0.5</changefreq>
</url>
+
+ <url>
+ <loc>https://supabase.com/blog/2022/03/29/graphql-now-available</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
+ <url>
+ <loc>https://supabase.com/blog/2022/03/30/supabase-enterprise</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
+
+ <url>
+ <loc>https://supabase.com/blog/2022/03/31/supabase-edge-functions</loc>
+ <changefreq>weekly</changefreq>
+ <changefreq>0.5</changefreq>
+ </url>
</urlset>