Axios Interceptors1 axios interceptors 설정하기(feat.cookie) 🍪axios interceptors 설정하기(feat.cookie)1. axios 인터셉터 설정const axiosInstance = axios.create({ baseURL: process.env.NEXT_PUBLIC_API_URL, headers: { 'Content-Type': 'application/json', },});2. 요청 인터셉터 설정axiosInstance.interceptors.request.use( async (config: InternalAxiosRequestConfig) => { const excludedUrls = ['/auth/tokens']; if (excludedUrls.some((url) => config.url?.includes(url))) {.. 2024. 8. 6. 이전 1 다음 반응형