Skip to content

webpnk/supabase-edge-serve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

webpnk/supabase-edge-serve

A Deno.serve() wrapper for Supabase edge runtime

Features:

  • CORS auto-handled
  • extra response param with pre-configured options, to use instead of vanilla Response

Usage

import { serve } from "https://deno.land/x/[email protected]/mod.ts";

serve((req, response, info) => {
    return response.json({ success: true }, { status: 201 })
})

With custom cors

import { serve } from "https://deno.land/x/[email protected]/mod.ts";

serve((req, response, info) => {
    return response.json({ success: true }, { status: 201 })
}, {
    cors: {
        origin: 'https://custom-origin.com',
    }
})

About

Supabase edge runtime helper function

Resources

License

Stars

Watchers

Forks

Packages

No packages published