Skip to content

Commit

Permalink
Update download function to use fetch instead of axios (generated by…
Browse files Browse the repository at this point in the history
… blackbox.ai )
  • Loading branch information
saiyamdubey committed Feb 13, 2024
1 parent ca2affd commit e5f8bd1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pages/api/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}

try {
console.log("hello1")
const response = await axios.get(url as string);
console.log(response.data)
const data = response.data;
console.log("hello1")
const response = await fetch(url as string);
console.log(response.json())
const data = response.json();
res.status(200).send(data);
} catch (error) {
res.status(500).send('error');
Expand Down

0 comments on commit e5f8bd1

Please sign in to comment.