-
Notifications
You must be signed in to change notification settings - Fork 248
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
Bl express node example #976
Conversation
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 is awesome, Bret — thanks for doing this.
This is an example setup where we have adapted the Remix Express starter app to use Hydrogen. A few things are not yet functional: | ||
|
||
1. The app does not have a cache implementation. So sub-requests to the Storefront API won't be cachable. | ||
1. The app does not yet utilize [`storefrontRedirect`](https://shopify.dev/docs/api/hydrogen/2023-04/unstable/utilities/storefrontredirect). This will be added when Remix releases middleware. |
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.
1. The app does not yet utilize [`storefrontRedirect`](https://shopify.dev/docs/api/hydrogen/2023-04/unstable/utilities/storefrontredirect). This will be added when Remix releases middleware. | |
1. Our [`storefrontRedirect`](https://shopify.dev/docs/api/hydrogen/2023-04/unstable/utilities/storefrontredirect) function, which handles redirects that are set in the Shopify Admin, must be set up in your server file. As the shape of the response isn't guaranteed, we haven't included this here. When Middleware is available in Remix, we'll add this into the example, until then, you can look to our [source code](https://github.com/Shopify/hydrogen/blob/2023-04/packages/hydrogen/src/routing/redirect.ts) to create your own implementation. |
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.
Thanks Bret!
Just one thing, this example is missing .env
so it doesn't work out of the box. You probably have it locally but it wasn't added to the PR. Can you force add it?
2406c3f
to
464c9e6
Compare
WHY are these changes introduced?
This is an example setup where we have adapted the Remix Express starter app to use Hydrogen. A few things are not yet functional:
storefrontRedirect
. This will be added when Remix releases middleware.npx shopify hydrogen generate route
Also I updated the CLI to allow the route generation to work in non-oxygen hydrogen apps.