From 0b177a24506831cc807c6c3090bab963afe25fe8 Mon Sep 17 00:00:00 2001 From: Akash Kava <39438041+ackava@users.noreply.github.com> Date: Tue, 13 Sep 2022 15:48:51 +0530 Subject: [PATCH] Added s3 upload --- .vscode/settings.json | 12 ++++++++++++ index.js | 9 ++++----- package.json | 1 + testfx.js | 3 +++ 4 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 .vscode/settings.json create mode 100644 testfx.js diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..255468e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,12 @@ +{ + "terminal.integrated.profiles.windows": { + "PowerShell": { + "source": "PowerShell", + "args": [ + "-ExecutionPolicy", + "Bypass" + ] + } + }, + "terminal.integrated.defaultProfile.windows": "PowerShell" +} \ No newline at end of file diff --git a/index.js b/index.js index f8899a6..0195932 100644 --- a/index.js +++ b/index.js @@ -6,16 +6,15 @@ exports.handler = async (event) => { rawPath, queryStringParameters: { url, - thumbnails, - } + } = {} } = event; if (rawPath.startsWith("/probe")) { return await FFProbe.probe(url); } - if (rawPath.startsWith("/thumb")) { - return await FFMpeg.thumbnails(url, thumbnails); - } + // if (rawPath.startsWith("/thumb")) { + // return await FFMpeg.thumbnails(url, thumbnails); + // } return { event, diff --git a/package.json b/package.json index f3c2c47..6a5121b 100644 --- a/package.json +++ b/package.json @@ -21,6 +21,7 @@ "ffmpeg-static": "^5.1.0", "@azure/storage-blob": "^12.11.0", "fluent-ffmpeg": "^2.1.2", + "node-fetch": "^2.6.7", "tmp-promise": "^3.0.3" }, "devDependencies": { diff --git a/testfx.js b/testfx.js new file mode 100644 index 0000000..ae9f20e --- /dev/null +++ b/testfx.js @@ -0,0 +1,3 @@ +const fetch = require("node-fetch"); +fetch("https://dhjifbkdiccu3idea5no3cczsq0swjky.lambda-url.us-east-1.on.aws/a", +{ method: "POST", body: "{}", headers: { "content-type": "application/json" } }).then((r) => r.text().then(console.log)); \ No newline at end of file