yarn install
yarn start
- just write a task file, create a file screenshot.js to tasks dir. and write below...
module.exports = async function(browser) {
const page = await browser.newPage();
await page.goto('https://example.com');
await page.screenshot({path: 'example.png'});
browser.close();
}
- send a command to http server.
curl -XPOST -d name=screenshot http://127.0.0.1:3000/task