Skip to content
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

Storybook Nginx configuration for production deployment #402

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

ty2k
Copy link
Contributor

@ty2k ty2k commented Jul 5, 2024

This updates the React component library's Storybook app Nginx configuration to handle routing according to these rules:

  • Requests to / will be redirected to the B.C. Design System landing page on gov.bc.ca
    • Ex: A GET request to https://<design-system-subdomain>.gov.bc.ca will go to BCDS page
  • Requests to any valid address starting with /react-components/ will get served the Storybook app, which handles its own routing client-side after the first page load
    • Ex: A GET request to https://<design-system-subdomain>.gov.bc.ca/react-components/ will go to Storybook
    • Ex: https://<design-system-subdomain>.gov.bc.ca/react-components/?path=/docs/components-button-button--docs goes to Storybook's Button documentation page
  • Requests to /react-components will be redirected to /react-components/ (trailing slash)
  • Requests that would result in 404 errors are redirected to the BCDS page

Keeping this Nginx configuration where it is makes sense for now, but it might need a re-think if we start serving multiple apps from one subdomain at different paths. In that case, it might make more sense to move the Nginx configuration to somewhere else in this repo, outside of packages/react-components.

@ty2k ty2k requested a review from mkernohanbc July 5, 2024 19:04
@ty2k ty2k self-assigned this Jul 5, 2024
@ty2k ty2k added this to the Components library v0.1.0 release milestone Jul 5, 2024
@mkernohanbc mkernohanbc added enhancement New feature or request dependencies Pull requests that update a dependency file and removed enhancement New feature or request labels Jul 8, 2024
Copy link
Contributor

@mkernohanbc mkernohanbc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All makes sense to me, no notes!

@ty2k
Copy link
Contributor Author

ty2k commented Jul 22, 2024

We have provisioned designsystem.gov.bc.ca as the subdomain that Storybook will be served from.

I have created a Route object in OpenShift pointing that domain to our production deployment's Service object.

The Storybook site is currently being served from https://designsystem.gov.bc.ca/, and after this PR gets merged, that will change to https://designsystem.gov.bc.ca/react-components/.

@ty2k ty2k merged commit 0c30caa into main Jul 22, 2024
2 checks passed
@ty2k ty2k deleted the feature/nginx-config-for-production branch July 22, 2024 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants