import { Hono } from 'jsr:@hono/hono'
import { cors } from 'jsr:@hono/hono/cors'
const functionName = 'hello-world'
const app = new Hono().basePath(`/${functionName}`)
app.use('*', cors({
origin: '*',
allowHeaders: ['authorization', 'x-client-info', 'apikey'],
allowMethods: ['POST', 'GET', 'OPTIONS', 'PUT', 'DELETE'],
credentials: true,
}))
app.options('*', (c) => {
return c.json('ok', 200)
})
app.get('/', (c) => c.text('Hello from edge functions!'))
const org = new Hono()
org.get('/', (c) => c.text('Hello from org route!'))
org.get('/:id/invite', (c) => c.text(`Hello from org invite route with id: ${c.req.param('id')}`))
app.route('/org', org)
Deno.serve(app.fetch)
import { Hono } from 'jsr:@hono/hono'
import { cors } from 'jsr:@hono/hono/cors'
const functionName = 'hello-world'
const app = new Hono().basePath(`/${functionName}`)
app.use('*', cors({
origin: '*',
allowHeaders: ['authorization', 'x-client-info', 'apikey'],
allowMethods: ['POST', 'GET', 'OPTIONS', 'PUT', 'DELETE'],
credentials: true,
}))
app.options('*', (c) => {
return c.json('ok', 200)
})
app.get('/', (c) => c.text('Hello from edge functions!'))
const org = new Hono()
org.get('/', (c) => c.text('Hello from org route!'))
org.get('/:id/invite', (c) => c.text(`Hello from org invite route with id: ${c.req.param('id')}`))
app.route('/org', org)
Deno.serve(app.fetch)