simonw / datasette-cors

Datasette plugin for configuring CORS headers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add documentation to the README

simonw opened this issue · comments

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

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);