Test your proxy API to bypass CORS issues when working with external APIs locally.
// Instead of calling the external API directly:
// fetch('https://api.example.com/data')
// Use your proxy:
const response = await fetch('https://corsy.vercel.app/api/proxy?url=' + encodeURIComponent('https://api.example.com/data'))
const data = await response.json()
// Corsy will return the response immediately without processing anything.
console.log(data)const response = await fetch('/api/proxy?url=' + encodeURIComponent('https://api.example.com/data'), {
method: 'POST',
headers: {
'Authorization': 'Bearer your-token',
'Content-Type': 'application/json'
},
body: JSON.stringify({ key: 'value' })
})