simonw / datasette-cors

Datasette plugin for configuring CORS headers
Apache License 2.0
11 stars 1 forks source link

Add documentation to the README #2

Closed simonw closed 5 years ago

simonw commented 5 years ago

Here's the metadata.json I have been testing with:

{
    "title": "datasette-cors demo",
    "plugins": {
        "datasette-cors": {
            "host_wildcards": ["https://*.example.com"]
        }
    }
}

I also tested "hosts": ["https://www.example.com"] and "allow_all": true

simonw commented 5 years ago

Then test it by opening a browser devtools console on https://www.example.com/ and running the following:

fetch("http://127.0.0.1:8001/fixtures.json").then(r => r.json()).then(console.log);