Skip to content

CORS example #7

@typeoneerror

Description

@typeoneerror

Following along with a basic tutorial for jsonapi-resources, I got stuck on the Ember.js side when I tried to load data:

[Report Only] Refused to connect to 'http://localhost:3000/articles/1/author' because it violates the following Content Security Policy directive: "connect-src 'self' ws://localhost:49152 ws://0.0.0.0:49152 http://0.0.0.0:4200/csp-report".

XMLHttpRequest cannot load http://localhost:3000/articles/2/author. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed access.

Would make sense to add a demo of utilizing https://github.com/cyu/rack-cors (or similar) to configure the Rails side of things. If this is in the demo, I can't find it.

Might even be pretty sweet to include rack-cors as a dependency and provide a reasonable default setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions