Skip to content

Commit 2d63d76

Browse files
committed
Fix where localmode is set
1 parent 098219b commit 2d63d76

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

src/index.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ export async function run(req: Request, ctx: Helix.UniversalContext): Promise<Re
4545

4646
let devsitePaths;
4747
let devsitePathsUrl;
48+
49+
let localMode = false;
50+
// check to see if we're in local devmode or if content is coming from github
51+
if(origin === 'http://127.0.0.1:3003') {
52+
log.debug(' Local mode detected');
53+
localMode = true;
54+
}
55+
4856
// retrieve the devsitepaths.json file based on if authorization is present
4957
if(req.headers.get('authorization')) {
5058
devsitePathsUrl = `https://main--adp-devsite-stage--adobedocs.aem.live/franklin_assets/devsitepaths.json`;
@@ -154,11 +162,8 @@ export async function run(req: Request, ctx: Helix.UniversalContext): Promise<Re
154162
}
155163

156164
let contentUrl;
157-
let localMode = false;
158165
// check to see if we're in local devmode or if content is coming from github
159-
if(origin === 'http://127.0.0.1:3003') {
160-
log.debug(' Local mode detected');
161-
localMode = true;
166+
if(localMode) {
162167
let flatPath = path.replace('/src/pages', '');
163168
contentUrl = `${origin}${flatPath}`;
164169
} else {

0 commit comments

Comments
 (0)