Skip to content

Commit

Permalink
add replace on shopify (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
guitavano authored Oct 16, 2024
1 parent 5f36103 commit abee205
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions shopify/loaders/proxy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Route } from "../../website/flags/audience.ts";
import { TextReplace } from "../../website/handlers/proxy.ts";
import { AppContext } from "../mod.ts";
import { withDigestCookie } from "../utils/password.ts";

Expand Down Expand Up @@ -32,11 +33,13 @@ const buildProxyRoutes = (
includeSiteMap,
generateDecoSiteMap,
excludePathsFromDecoSiteMap,
replaces,
}: {
extraPaths: string[];
includeSiteMap?: string[];
generateDecoSiteMap?: boolean;
excludePathsFromDecoSiteMap: string[];
replaces: TextReplace[];
ctx: AppContext;
},
) => {
Expand Down Expand Up @@ -65,6 +68,7 @@ const buildProxyRoutes = (
url: urlToProxy,
host: hostToUse,
customHeaders: withDigestCookie(ctx),
replaces,
},
},
});
Expand Down Expand Up @@ -126,6 +130,7 @@ export interface Props {
* @title Exclude paths from /deco-sitemap.xml
*/
excludePathsFromDecoSiteMap?: string[];
replaces?: TextReplace[];
}

/**
Expand All @@ -137,6 +142,7 @@ function loader(
includeSiteMap = [],
generateDecoSiteMap = true,
excludePathsFromDecoSiteMap = [],
replaces = [],
}: Props,
_req: Request,
ctx: AppContext,
Expand All @@ -146,6 +152,7 @@ function loader(
excludePathsFromDecoSiteMap,
includeSiteMap,
extraPaths: extraPathsToProxy,
replaces,
ctx,
});
}
Expand Down

0 comments on commit abee205

Please sign in to comment.