import axios , { AxiosInstance , AxiosRequestConfig , AxiosError } from 'axios' ; const instance = axios . create ( { baseURL : '/' , withCredentials : true , } ) ; const requestHandler = ( config ) => { config . timeout = 30000 ; return config ; } ; instance . interceptors . request . use ( requestHandler ) ; instance . interceptors . response . use ( undefined , ( error ) => { if ( axios . isCancel ( error ) ) { console . log ( `request cancelled` ) ; } return Promise . reject ( error . response ?. data ?. error ) ; } ) ; export default instance ;