woops
This commit is contained in:
parent
102de84d1b
commit
27215cb4aa
@ -108,7 +108,7 @@ Do you see the point here? We actually do not need the session if we already hav
|
|||||||
|
|
||||||
Let's write now some logic to handle this, we want to run our app with a `shopifyDomain` we define, something like:
|
Let's write now some logic to handle this, we want to run our app with a `shopifyDomain` we define, something like:
|
||||||
|
|
||||||
```typescript
|
```ts
|
||||||
export async function requireShopifyDomain(request: Request) {
|
export async function requireShopifyDomain(request: Request) {
|
||||||
if(process.env.NODE_ENV === "development" && process.env.RUN_AS_SHOPIFY_DOMAIN) {
|
if(process.env.NODE_ENV === "development" && process.env.RUN_AS_SHOPIFY_DOMAIN) {
|
||||||
const shopifyDomain = process.env.RUN_AS_SHOPIFY_DOMAIN;
|
const shopifyDomain = process.env.RUN_AS_SHOPIFY_DOMAIN;
|
||||||
@ -124,7 +124,7 @@ Excellent, we can retrieve now the `shopifyDomain` we define as an env, just in
|
|||||||
|
|
||||||
Let's write now a simple utility to handle all loaders requests in the same way:
|
Let's write now a simple utility to handle all loaders requests in the same way:
|
||||||
|
|
||||||
```typescript
|
```ts
|
||||||
export function handleLoaderRequest<T>(
|
export function handleLoaderRequest<T>(
|
||||||
request: Request,
|
request: Request,
|
||||||
callback: (shopifyDomain: string) => Promise<T>
|
callback: (shopifyDomain: string) => Promise<T>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user