33 lines
703 B
JavaScript
33 lines
703 B
JavaScript
import {
|
|
createContainer,
|
|
getContainers,
|
|
getBlobs,
|
|
createBlob,
|
|
uploadFile,
|
|
deleteBlob,
|
|
} from "../../../actions/azurestorage";
|
|
|
|
import middleware from "../middleware/middleware";
|
|
import nextConnect from "next-connect";
|
|
|
|
const ApiProxy = nextConnect();
|
|
ApiProxy.use(middleware);
|
|
|
|
ApiProxy.get(async (req, res) => {
|
|
var containerName = req.query.container;
|
|
var blobName = req.query.blobname;
|
|
console.log(containerName, blobName);
|
|
|
|
await deleteBlob(containerName, "files/" + blobName).then((data) => {
|
|
return res.status(200).json({ data: data });
|
|
});
|
|
});
|
|
|
|
export const config = {
|
|
api: {
|
|
bodyParser: false,
|
|
},
|
|
};
|
|
|
|
export default ApiProxy;
|