Make the URL configurable

This commit is contained in:
Kuba Orlik 2022-04-24 18:58:08 +02:00
parent 0b31302ee3
commit a7987d400f

View File

@ -52,6 +52,10 @@ router.get("/", async (ctx) => {
s.push(`Got request to screenshot ${params.url}<pre>`);
const id = uuid();
let docker_id = "";
if (!params.url) {
ctx.body = "specify url!";
return;
}
const starter = spawn(
"docker",
[
@ -62,7 +66,7 @@ router.get("/", async (ctx) => {
`${process.cwd()}/static:/opt/static`,
"headless-fox",
"./script3.sh",
'{"url": "pearson.pl", "third_party_domains": ["hotjar.com", "cookielaw.org"]}',
`{"url": "${params.url}", "third_party_domains": ["hotjar.com", "cookielaw.org", "facebook.com"]}`,
id,
],
{ cwd: process.cwd() }