mirror of
https://github.com/SrIzan10/makesweet-api.git
synced 2026-05-01 10:55:14 +00:00
edit docs
This commit is contained in:
2
index.js
2
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);
|
||||
|
||||
@@ -26,3 +26,5 @@
|
||||
<p>make text go before images: use &textfirst=1</p>
|
||||
<pre><code>curl -H "Authorization: key" -XPOST "https://api.makesweet.com/make/heart-locket?text=frog&textfirst=1" -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>
|
||||
|
||||
Reference in New Issue
Block a user