Skip to content

Get CORS error when trying to use the swagger page to create a ledger. #167

@ellipsis-apps

Description

@ellipsis-apps

I installed Fluree using Docker to my Raspberry PI 4.
I'm using a browser on my laptop (same network as the PI)
I've updated my etc/hosts file on the laptop to use a name of "fluree.pi" to access the Swagger page.
The swagger page comes up, but when I try to create a ledger using the following json object, I get a CORS error. How do I resolve this?
{
"ledger": "super-to-do",
"insert": {
"@id": "c822bc47-7833-4a46-8fca-34686fa0b930",
"completed": false,
"description": "first something to do"
}
}

This is the shown curl in Swagger:
curl -X 'POST'
'http://fluree.pi:58090/fluree/create'
-H 'accept: application/json'
-H 'Content-Type: application/json'
-d '{
"ledger": "super-to-do",
"insert": {
"@id": "c822bc47-7833-4a46-8fca-34686fa0b930",
"completed": false,
"description": "first something to do"
}
}'

This is the response:

d | Failed to fetch.Possible Reasons:CORSNetwork FailureURL scheme must be "http" or "https" for CORS request. -- | --

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions