Interim Commit

This commit is contained in:
oitsjustjose 2021-06-21 17:23:00 -05:00
commit d69b6bef0c
12 changed files with 258 additions and 198 deletions

View file

@ -35,16 +35,16 @@ const storage = multer.diskStorage({
cb(null, `${file.fieldname}-${moment().toISOString()}`)
}
})
const uploader = multer({ storage })
// 52428800 = 50mb
const uploader = multer({ storage, limits: { fileSize: 52428800 } })
// Image Uploader
app.put("/api/img", uploader.single("image"), putImageHandler)
app.get("/i/:slug", getImageHandler)
// Pastebin
app.put("/api/paste", putTxtHandler)
app.get("/p/:slug", getTxtHandler)
// URL Shortener
// URL Shortener -- LAST for a reason.
app.put("/api/url", putUrlHandler)
app.get("/u/:slug", getUrlHandler)
app.get("/:slug", getUrlHandler)
export default app