Closed michael-spengler closed 4 years ago
Heya @michael-spengler 👋
Ah awesome, A CORs module is a great contribution to have somewhere so nice one! I'm not aware of any alternative cors libraries atm so your PR is great to have.
Given Mith, Attain and Opine are all essentially connect middleware inspired I wonder if a single exported module could handle cors for all of them but that can be for another time!
Once the PR is in it would be awesome to get something added to the Opine examples if you have the time? (Or I can if busy 😄)
Hey @asos-craigmorten. Today was a cors day for me - I started at about level 0 :) so the PR from above got merged - the owner of the repository will fix some issues which I had left due to my beginner level in those topics :)
To have a quick solution for uncritical apps / backend / routes I provided https://deno.land/x/simplecors@1.0.0 where I use opine for the usage example. This is sufficient for me as I'm mostly developing uncritical fun apps. Therefore I close this issue.
Good News:
The following works now:
import { opineCors } from "https://deno.land/x/cors/mod.ts";
const app = opine();
app.use(opineCors())
Reopening this issue so you can check whether you want to update the documentation. @asos-craigmorten
Amazing @michael-spengler! Yep think would be great to get an example in the repo using this 😊
Hey @asos-craigmorten, can we close this issue and open another for the docs, to be more legible and organized.
First of all: Thank you for this module.
As I could not find a simple & quick solution for cors enablement so far, I created a corresponding PR on https://deno.land/x/cors.
If you know any better approaches, please let me know.