cardserver
Advanced tools
Comparing version 2.1.0 to 2.1.1
@@ -32,15 +32,19 @@ #!/usr/bin/env node | ||
const result = await page.goto(url) | ||
await page.evaluateHandle('document.fonts.ready') | ||
const status = result.status() | ||
try { | ||
const result = await page.goto(url) | ||
res.status(status) | ||
await page.evaluateHandle('document.fonts.ready') | ||
if (!result.ok()) { | ||
if (!result.ok()) { | ||
res.status(result.status()) | ||
return res.send() | ||
} | ||
const screenshot = await page.screenshot({ path: imagePath }) | ||
serve(screenshot, res) | ||
} catch (err) { | ||
res.status(502) | ||
return res.send() | ||
} | ||
const screenshot = await page.screenshot({ path: imagePath }) | ||
serve(screenshot, res) | ||
}) | ||
@@ -47,0 +51,0 @@ } |
{ | ||
"name": "cardserver", | ||
"version": "2.1.0", | ||
"version": "2.1.1", | ||
"description": "A simple social media card renderer written using Puppeteer – screenshot card-like webpages on-the-fly", | ||
@@ -5,0 +5,0 @@ "main": "cardserver.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7818
60