Is there a way to delete deployed function without deleting the site?
I have set up a demo to explain this case: secretive-society.netlify.app
The case: secretive-society.netlify.app should keep some top secret information secure, but accidently deployed some of them publicly. One of their members have also shared leaked deploy-previews (https://5ffe7254416d200007d96d98--secretive-society.netlify.app/) to the public. They quickly repair it and deploy new version. How do they stop leaked information being accessed?
function/hello
exports.handler = async function(event, context) {
return {
statusCode: 200,
body: JSON.stringify({message: "TOP SECRET INFORMATION are kept safe and secure ? are you sure ?"})
}
}
index.html/#script
fetch(location.href+"/.netlify/functions/hello")
.then(function(response){
response.json()
.then(function(data){
console.log(response.status,data)
document.getElementById('log').innerHTML=data.message
})
})
.catch(function(error){
console.log(error)
})