Move to a cental upload api
This commit is contained in:
parent
1d620e3ec0
commit
a44ca7d8af
@ -1,8 +1,8 @@
|
|||||||
import { StatusCodes } from "http-status-codes";
|
import { StatusCodes } from "http-status-codes";
|
||||||
import multer from "multer";
|
import multer from "multer";
|
||||||
import nextConnect from "next-connect";
|
import nextConnect from "next-connect";
|
||||||
import { createFile } from "../../../utils/helpers/fileHelpers";
|
import { createFile } from "../../utils/helpers/fileHelpers";
|
||||||
import { getUserByUploadKey } from "../../../utils/helpers/userHelpers";
|
import { getUserByUploadKey } from "../../utils/helpers/userHelpers";
|
||||||
|
|
||||||
const apiRoute = nextConnect({
|
const apiRoute = nextConnect({
|
||||||
onError(error, req, res) {
|
onError(error, req, res) {
|
||||||
@ -23,7 +23,7 @@ apiRoute.use(
|
|||||||
limits: {
|
limits: {
|
||||||
fileSize: process.env.MAX_FILE_SIZE,
|
fileSize: process.env.MAX_FILE_SIZE,
|
||||||
},
|
},
|
||||||
}).single("sharex")
|
}).single("file")
|
||||||
);
|
);
|
||||||
|
|
||||||
apiRoute.post(async (req, res) => {
|
apiRoute.post(async (req, res) => {
|
Reference in New Issue
Block a user