Skip to content

Commit

Permalink
Merge pull request #36 from HubSpot/bmatto/document-membership-previe…
Browse files Browse the repository at this point in the history
…w-dev-server

Document membership preview dev server
  • Loading branch information
bmatto authored Mar 19, 2024
2 parents b6c4386 + f8a709f commit 3e4a2dc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/reference/cms-dev-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,18 @@ The CMS Dev Server offer a route for partials; `/partial/[partial_file_name]`.

Partials are very thin and do not support GraphQL or `hublDataTemplate`. In the context of the dev server `hublParameters` will always be and empty object `{}`.

## Proxying Private Pages

Making use of the CMS React local dev with proxied pages is powerful. It allows you to make changed to your React modules locally and see how they will look within the context of a page. This is no less true for pages that are private via a password or other means.

### Proxied User View

Visit a private page and login with the configured method. Once authenticated Once there add `hslocal.net:3000` or `localhost:3000` to your root domain just as you would with proxying a public page. This will allow you to develop your React modules locally in the context of an authenticated live page.

### Proxied Preview

Visit the page as a "preview". You can do this from the page editor by clicking the "Preview" button and then "Open in a new tab". Once there add `hslocal.net:3000` or `localhost:3000` to your root domain. This will allow you to do local development on a private pages. Further if you pass an `email` param it will use the associated contact as context for viewing the page. Your URL in this case wil look like `http://my-domain.com.localhost:3000/private-page-path?hs_preview=[preview_key]&[email protected]`.

## Storybook

`cms-dev-server` includes a [Storybook](https://storybook.js.org/) integration. Pass a `--storybook` option when starting the server to start a Storybook instance alongside the built-in dev server. You may then add `.stories.jsx` files alongside your components to build stories for testing or development. At the root http://hslocal.net:3000 page there should be a link to the Storybook UI for your project.
Expand Down

0 comments on commit 3e4a2dc

Please sign in to comment.