From 05a1aa16bce1c117f4ce4b31d0dc8fad4438af69 Mon Sep 17 00:00:00 2001 From: gliggy Date: Sun, 26 Dec 2021 11:10:44 -0500 Subject: [PATCH] edit docs --- index.js | 2 ++ public/index.html | 2 ++ 2 files changed, 4 insertions(+) diff --git a/index.js b/index.js index 2ec3324..dfae7c6 100644 --- a/index.js +++ b/index.js @@ -18,6 +18,7 @@ const app = express() app.use(express.static('public')); app.post('/make/:template', upload.any('images'), handleErrors, (req, res) => { + console.log("HEADERS", req.headers); const authorization = String(req.header('authorization')).replace(/[^a-zA-Z0-9]/g, ''); if (authorization.length === 0 || !fs.existsSync(path.join(process.cwd(), 'keys', authorization))) { throw new ApiError(401, 'You need a good Authorization header'); @@ -126,6 +127,7 @@ class Generator { this.textBorder = border; } addImages(files) { + console.log("FILES", {files}); if (!files) { return; } for (const file of files) { this.images.push(file.path); diff --git a/public/index.html b/public/index.html index 5699e7a..be0664c 100644 --- a/public/index.html +++ b/public/index.html @@ -26,3 +26,5 @@

make text go before images: use &textfirst=1

curl -H "Authorization: key" -XPOST "https://api.makesweet.com/make/heart-locket?text=frog&textfirst=1" -F images=@frog.jpg -o frog.gif

+ +

Here is an example discord bot using this api: https://github.com/gliggy/mkswt-discord