Skip to content

Instantly share code, notes, and snippets.

@elblivion
Created November 11, 2020 08:42
Show Gist options
  • Save elblivion/c71038156fa5fd51d4d61dcd14a3a6a9 to your computer and use it in GitHub Desktop.
Save elblivion/c71038156fa5fd51d4d61dcd14a3a6a9 to your computer and use it in GitHub Desktop.
Dockerised headless Fastly-Debug
docker run --rm --shm-size=512m buildkite/puppeteer node -e "
require('puppeteer').launch({ args: ['--no-sandbox', '--disable-setuid-sandbox'] })
.then(browser => browser.newPage()
.then(page => page.goto('https://www.fastly-debug.com')
.then(() => page.waitFor(() => document.querySelector('#json').textContent))
.then(jsonEl => jsonEl.jsonValue())
.then(console.log)
.finally(() => page.close())
).finally(() => browser.close()),
err => console.log('Error fetching Fastly debug info', err)
)
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment