Skip to content

Commit

Permalink
Replace axios with fetch API (generated by blackbox.ai )
Browse files Browse the repository at this point in the history
  • Loading branch information
saiyamdubey committed Feb 14, 2024
1 parent 2f7306a commit 6c31e12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pages/api/test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


import { NextApiRequest, NextApiResponse } from 'next';
import axios from 'axios';
// import axios from 'axios';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
let { url } = req.query;
Expand All @@ -10,7 +10,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
const response = await fetch(url as string,{
cache:"no-store"
} );
console.log("response 1",response)
console.log("response 1 :: ",response)
const data = response.json();
res.status(200).json(data);
} catch (error) {
Expand Down

0 comments on commit 6c31e12

Please sign in to comment.