diff --git a/index.ts b/index.ts index df59b2a..d793740 100644 --- a/index.ts +++ b/index.ts @@ -14,7 +14,7 @@ const base64 = Buffer.from( app.use(Express.static(__dirname + "/out")); -app.post("/", (req, res) => { +app.post("/", async (req, res) => { const header = req.header("authorization"); if (header == null) { @@ -39,6 +39,7 @@ app.post("/", (req, res) => { return; } + await sleep(10); updateWebsite(); res.send("Done!"); @@ -58,3 +59,7 @@ function updateWebsite() { execSync(`wget -O ${zipPath} '${url}'`); execSync(`yes All | unzip ${zipPath}`); } + +function sleep(seconds: number) { + return new Promise((resolve) => setTimeout(resolve, seconds * 1000)); +}