-
-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redirection to Strapi endpoints for mobile app users #1641
Redirection to Strapi endpoints for mobile app users #1641
Conversation
…essages on mobile users to the new Strapi API endpoints
This pull request has been linked to Shortcut Story #19579: Redirection to Strapi endpoint for mobile app users. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The static json file is being moved out of the versioning system to an external location. Is there any synchronisity between the contents of the json file and the version of the mobile/main site? How are updates to the json file captured, reviewed and deployed?
@@ -96,6 +96,8 @@ spec: | |||
value: "varnish-{{ .Values.deployEnv }}-{{ .Release.Revision }}" | |||
- name: SEARCH_HOST | |||
value: "{{ .Values.nginx.SEARCH_HOST }}" | |||
- name: STRAPI_LOCATION | |||
value: "{{ .Values.localSettings.STRAPI_LOCATION }}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs
- For .Values.localSettings.STRAPI_LOCATION to be defined in the values.yaml file of the chart. You can populate with a sensible default if all Sefaria environments will redirect to the same endpoint
- per-environment values to populated in the environment values files - build/ci/production-values.yaml for prod, build/ci/sandbox-values.yaml for per-commit tests, build/ci/integration-values.yaml for integration tests and create-cauldron.sh in the cauldrons repo for cauldrons.
Tested it on the mobile app using the cauldron URL and it worked |
Story details: https://app.shortcut.com/sefaria/story/19579
Forewarning
This is likely wrong lol. I only tested the redirection part in an example Nginx Docker container on my local. I don't know the correct location or way to reference the secret environment variable used to define
STRAPI_LOCATION
. Since it's only for production, the port shouldn't be necessary.Background
I integrated Strapi CMS into Sefaria's codebase. It's currently used on the web interface to serve the content for modals, banners, and sidebar ads. The mobile app currently uses static JSON files for that content which the site needs to redeployed every time when a change needs to be made (see here). To remove the last remaining dependency of the old interrupting message code and ensure backwards compatibility with current mobile app users, there needs to be redirects to the new API endpoints. Having these redirects should work, because the fetch call in the mobile app should default to following redirects though it isn't explicitly specified.
Requirements (What I was trying to accomplish)
Further considerations
In the future, the mobile app's URLs for the endpoints will be changed to use the new Strapi based ones, but those will be included in a new update.
Conclusion
I need to have this done soon (likely by the end of this week), so I tried to get the ball rolling for you guys (@edamboritz and @BrendanGalloway) even though I have no idea what I'm doing :)