edit docs

This commit is contained in:
gliggy
2021-12-26 11:10:44 -05:00
parent b3e36081b2
commit 05a1aa16bc
2 changed files with 4 additions and 0 deletions

View File

@@ -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);

View File

@@ -26,3 +26,5 @@
<p>make text go before images: use &amp;textfirst=1</p>
<pre><code>curl -H &quot;Authorization: key&quot; -XPOST &quot;https://api.makesweet.com/make/heart-locket?text=frog&amp;textfirst=1&quot; -F images=@frog.jpg -o frog.gif</code></pre>
<hr />
<h2>Here is an example discord bot using this api: <a href="https://github.com/gliggy/mkswt-discord">https://github.com/gliggy/mkswt-discord</a></h2>