Skip to content

Commit 242499b

Browse files
author
Taylor Payne
committed
fixup! docs: explain a way to overcome CORS issue in example app
1 parent f00e0fa commit 242499b

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

README.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -151,30 +151,16 @@ If you want to test changes to frontend-platform against a micro-frontend locall
151151

152152
## Getting the example app to work with a tutor dev environment
153153

154-
Part of the example app functionality includes an API request to get the logged in user's profile information. This request will fail by default due to CORS restrictions. One way to overcome this is to create a tutor plugin that patches the settings needed for the request to be allowed.
155-
156-
1. Create an `example.py` file with the following contents:
154+
Part of the example app functionality includes an API request to get the logged in user's profile information. This request will fail by default due to CORS restrictions. To overcome this, patch `openedx-lms-development-settings` with the following settings (via a tutor plugin):
157155

158156
```python
159-
from tutor import hooks
160-
161-
hooks.Filters.ENV_PATCHES.add_items([
162-
(
163-
"openedx-lms-development-settings",
164-
"""
165157
# Used for the example app in the frontend-plugin library
166158
CORS_ORIGIN_WHITELIST.append("http://local.openedx.io:8080")
167159
LOGIN_REDIRECT_WHITELIST.append("local.openedx.io:8080")
168160
CSRF_TRUSTED_ORIGINS.append("http://local.openedx.io:8080")
169-
"""
170-
),
171-
])
172161
```
173162

174-
2. Install the plugin: `tutor plugins install example.py`
175-
3. Enable the plugin: `tutor plugins enable example`
176-
4. Restart the lms service: `tutor dev restart lms`
177-
5. http://local.openedx.io:8080/ should now successfully fetch the logged in user's name (if available)
163+
Make sure the plugin is installed, enabled, and then run `tutor dev restart lms` to make sure the new configuration is picked up.
178164

179165
# Production Deployment Strategy
180166

0 commit comments

Comments
 (0)