Skip to content

Commit

Permalink
feat: path validation if running locally
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielforster committed Jan 24, 2024
1 parent d62deb4 commit b5b049e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scraper/ports/processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ export async function handler (input: Input) {
const { url, placeId } = input;

try {
const browser = await puppeteer.launch({

const path = process.env.IS_OFFLINE
? undefined
: "/opt/nodejs/node_modules/@sparticuz/chromium/bin"

const browser = await puppeteer.launch({
args: chromium.args,
defaultViewport: chromium.defaultViewport,
executablePath: await chromium.executablePath("/opt/nodejs/node_modules/@sparticuz/chromium/bin"),
executablePath: await chromium.executablePath(path),
headless: chromium.headless,
ignoreHTTPSErrors: true,
protocolTimeout: 450_000,
Expand Down

0 comments on commit b5b049e

Please sign in to comment.