Giter Club home page Giter Club logo

Comments (3)

joshkoenig avatar joshkoenig commented on September 6, 2024

Couldn't tell you specifically, but it's a good opportunity to learn more about how HTTP routing and authorization works in D8! :)

from headless-drupal-angular.

pxwise avatar pxwise commented on September 6, 2024

@geraldvillorente I ran into this same issue with my local D8 setup. It turned out to be a CORS issue.

Chrome console: XMLHttpRequest cannot load http://d8rest.local/node/1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:3333' is therefore not allowed access.

I run nginx locally, so I was able to add one line in nginx.conf to bypass CORS. Be aware this is not a secure solution for a live web site but works fine for local development. For nginx, place this line somewhere in your nginx.conf server { } block:

add_header "Access-Control-Allow-Origin" $http_origin;

For Apache, see this article which includes a patch to .htaccess to bypass CORS restrictions.

from headless-drupal-angular.

kamkejj avatar kamkejj commented on September 6, 2024

To answer the original question a little bit. After enabling the rest modules, enable permissions for the Anon user or authenticated user depending on what access you want for the GET, POST, PATCH, DELETE operations.

Using the Rest UI module adds a GUI to set the Rest configuration instead of using the rest.settings.yml file.

from headless-drupal-angular.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.