20 lines
477 B
JavaScript
20 lines
477 B
JavaScript
import axios from "axios";
|
|
import https from "https";
|
|
|
|
// Create axios instance with SSL verification disabled for development
|
|
const axiosInstance = axios.create({
|
|
httpsAgent: new https.Agent({
|
|
rejectUnauthorized: false
|
|
})
|
|
});
|
|
|
|
export const fetchReq = async (url, headers) => {
|
|
try {
|
|
const response = await axiosInstance.get(url, headers);
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error("fetchReq error:", error.message);
|
|
return null;
|
|
}
|
|
};
|