Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hzswdef/manga
Manga website build with React & Drupal for dev stack learning purposes.
https://github.com/hzswdef/manga
Last synced: 2 months ago
JSON representation
Manga website build with React & Drupal for dev stack learning purposes.
- Host: GitHub
- URL: https://github.com/hzswdef/manga
- Owner: hzswdef
- License: cc0-1.0
- Created: 2024-04-18T14:45:13.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-27T20:00:53.000Z (9 months ago)
- Last Synced: 2024-04-28T18:40:03.157Z (9 months ago)
- Language: PHP
- Homepage: https://manga.hzswdef.cloud/
- Size: 698 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## CORS Policy
Required step to let the frontend part communicate with Drupal API.
In other words that will fix the following API requests error:`Access to XMLHttpRequest at 'http://localhost:8000/api' from origin 'http://localhost:8080' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.`
### Steps to fix:
1. Create the `web/sites/cors.services.yml` file, then put the following contents to the `cors.services.yml` file:
```yml
parameters:
cors.config:
enabled: true
allowedHeaders: ['*']
allowedMethods: ['*']
allowedOrigins: ['*']
allowedOriginsPatterns: []
exposedHeaders: false
maxAge: false
supportsCredentials: true
```
2. Create the `web/sites/default/settings.local.php` if you didn't have one. Add the following code to the `settings.local.php` file:
```php
$settings['container_yamls'][] = DRUPAL_ROOT . '/sites/cors.services.yml';
```