summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--index.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/index.js b/index.js
index bc19d1a..75fe2ec 100644
--- a/index.js
+++ b/index.js
@@ -5,11 +5,13 @@ const Koa = require('koa');
const app = new Koa();
(async () => {
- const browser = await puppeteer.launch({
+ let options = {
headless: true,
- executablePath: '/usr/bin/chromium-browser',
args: ['--no-sandbox', '--disable-setuid-sandbox']
- });
+ };
+ if (process.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD)
+ options.executablePath = '/usr/bin/chromium-browser';
+ const browser = await puppeteer.launch(options);
app.use(async ctx => {
if (ctx.query.url) {
const page = await browser.newPage();