Sindbad~EG File Manager
import AppError from "../../utils/apiError";
import catchAsync from "../../utils/catchAsync";
import { successResponse, failedResponse } from "../../utils/responseFormat";
const add = catchAsync(async (req, res, next) => {
if (!req.file.filename) {
return next(new AppError("File must be provided.", 500));
}
return successResponse(
res,
{
destination: req.file.destination,
filename: req.file.filename,
path: req.file.path,
},
"File saved successfully",
201
);
});
export default { add };
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists