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>`); s.push(`Got request to screenshot ${params.url}<pre>`);
const id = uuid(); const id = uuid();
let docker_id = ""; let docker_id = "";
if (!params.url) {
ctx.body = "specify url!";
return;
}
const starter = spawn( const starter = spawn(
"docker", "docker",
[ [
@ -62,7 +66,7 @@ router.get("/", async (ctx) => {
`${process.cwd()}/static:/opt/static`, `${process.cwd()}/static:/opt/static`,
"headless-fox", "headless-fox",
"./script3.sh", "./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, id,
], ],
{ cwd: process.cwd() } { cwd: process.cwd() }