init commit,
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# Open Graph Image Generation
|
||||
|
||||
Generate Open Graph images with Deno and Supabase Edge Functions, no framework needed. This is a fork of the awesome [@vercel/og](https://www.npmjs.com/package/@vercel/og), ported to run on Deno.
|
||||
|
||||
- Docs: https://deno.land/x/og_edge@0.0.2
|
||||
|
||||
## Run locally
|
||||
|
||||
```bash
|
||||
supabase functions serve --no-verify-jwt
|
||||
```
|
||||
|
||||
Navigate to http://localhost:54321/functions/v1/opengraph
|
||||
|
||||
## Deploy
|
||||
|
||||
```bash
|
||||
supabase functions deploy opengraph --no-verify-jwt
|
||||
```
|
@@ -0,0 +1,32 @@
|
||||
import React from 'https://esm.sh/react@18.2.0?deno-std=0.177.0'
|
||||
import { ImageResponse } from 'https://deno.land/x/og_edge@0.0.4/mod.ts'
|
||||
|
||||
export function handler(req: Request) {
|
||||
return new ImageResponse(
|
||||
(
|
||||
<div
|
||||
style={{
|
||||
fontSize: 100,
|
||||
color: 'black',
|
||||
background: 'white',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
padding: '50px 200px',
|
||||
textAlign: 'center',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
display: 'flex',
|
||||
}}
|
||||
>
|
||||
NICE! 🔥
|
||||
</div>
|
||||
),
|
||||
{
|
||||
width: 1200,
|
||||
height: 630,
|
||||
// Supported options: 'twemoji', 'blobmoji', 'noto', 'openmoji', 'fluent', 'fluentFlat'
|
||||
// Default to 'twemoji'
|
||||
emoji: 'twemoji',
|
||||
}
|
||||
)
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
// Follow this setup guide to integrate the Deno language server with your editor:
|
||||
// https://deno.land/manual/getting_started/setup_your_environment
|
||||
// This enables autocomplete, go to definition, etc.
|
||||
|
||||
import { handler } from './handler.tsx'
|
||||
|
||||
console.log(`Function "opengraph" up and running!`)
|
||||
|
||||
Deno.serve(handler)
|
Reference in New Issue
Block a user