Skip to content

Commit a617597

Browse files
committed
Updating readme install instructions, and changing admin configuration location
1 parent 4f0cba2 commit a617597

File tree

2 files changed

+27
-11
lines changed

2 files changed

+27
-11
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,23 @@ This can be used to allow AJAX and other requests to the Magento 2 REST API from
88

99
### 1. via composer
1010

11+
Edit `composer.json`
12+
13+
```
14+
{
15+
"repositories": [
16+
{
17+
"type": "vcs",
18+
"url": "https://github.com/splashlab/magento-2-cors-requests"
19+
}
20+
],
21+
"require": {
22+
"splashlab/magento-2-cors-requests": "dev-master"
23+
}
24+
}
25+
```
26+
1127
```
12-
composer require splashlab/magento-2-cors-requests
1328
php bin/magento setup:upgrade
1429
php bin/magento setup:static-content:deploy
1530
```
@@ -25,6 +40,12 @@ php bin/magento setup:upgrade
2540
php bin/magento setup:static-content:deploy
2641
```
2742

43+
### 3. Update Origin URL
44+
45+
In `Stores -> Configuration`, go to `General -> Web -> CORS Requests Configuration`.
46+
47+
Then edit the the `CORS Origin Url` field to the domain you want to enable cross-domain requests from. (i.e. http://example.com)
48+
2849
## How does it work?
2950

3051
The full implementation of CORS cross-domain HTTP requests is outside the scope of this README, but this is what this module does:
@@ -57,6 +78,7 @@ Not only can you create unlimited sliders but Product Slider module also allows
5778
- https://www.html5rocks.com/en/tutorials/cors/
5879
- https://stackoverflow.com/questions/29954037/how-to-disable-options-request
5980
- https://stackoverflow.com/questions/12320467/jquery-cors-content-type-options
81+
- https://github.com/magento/magento2/issues/8399
6082

6183

6284

etc/adminhtml/system.xml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
33
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
44
<system>
5-
<!--<tab id="corsRequests" translate="label" sortOrder="1000">-->
6-
<!--<label>CORS Requests Configuration</label>-->
7-
<!--</tab>-->
8-
<section id="corsRequests" translate="label" type="text" sortOrder="100"
9-
showInDefault="1" showInWebsite="1" showInStore="1">
10-
<label>CORS Requests Configuration</label>
11-
<tab>service</tab>
5+
<section id="web">
126
<resource>SplashLab_CorsRequests::config</resource>
13-
<group id="general" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
7+
<group id="corsRequests" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1"
148
showInStore="1">
15-
<label>General</label>
9+
<label>CORS Requests Configuration</label>
1610
<field id="origin_url" translate="label" type="text" sortOrder="40" showInDefault="1" showInWebsite="1"
1711
showInStore="1">
1812
<label>CORS Origin Url</label>
@@ -29,4 +23,4 @@
2923
</group>
3024
</section>
3125
</system>
32-
</config>
26+
</config>

0 commit comments

Comments
 (0)