sarlink-portal/utils/axiosInstance.ts
i701 9e2a2f430e
Some checks failed
Build and Push Docker Images / Build and Push Docker Images (push) Failing after 3m14s
refactor: update payment types and user interface, enhance error handling, and adjust API base URL
2025-04-05 23:25:17 +05:00

14 lines
347 B
TypeScript

import axios from "axios";
axios.defaults.xsrfCookieName = "csrftoken";
axios.defaults.xsrfHeaderName = "X-CSRFToken";
const axiosInstance = axios.create({
baseURL: process.env.SARLINK_API_BASE_URL,
validateStatus: (status) => {
return status < 500; // Resolve only if the status code is less than 500
},
});
export default axiosInstance;