Comments (3)
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.
@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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from headless-drupal-angular.