This commit is contained in:
Andrea 2024-12-30 09:36:03 +01:00
parent 102de84d1b
commit 27215cb4aa
Signed by: nullndr
GPG Key ID: 8DA8996EF89F33BB

View File

@ -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:
```typescript
```ts
export async function requireShopifyDomain(request: Request) {
if(process.env.NODE_ENV === "development" && 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:
```typescript
```ts
export function handleLoaderRequest<T>(
request: Request,
callback: (shopifyDomain: string) => Promise<T>