Middleware: withCors

CORS middleware.

Examples

Example 1

import { withCors } from '@supabase/middleware/cors'

export default {
  fetch: withCors(
    { origin: ['https://app.example.com'], credentials: true },
    async () => Response.json({ ok: true }),
  ),
}