skip to Main Content

Reactjs – AxiosError {message: 'Network Error' } while I make the axios.post for login form

I make the simple interceptors use axios: import axios from "axios"; const $api = axios.create({ withCredentials: true, baseURL: "http://localhost:9000/api", }); $api.interceptors.request.use((config) => { config.headers.Authorization = `Bearer ${localStorage.getItem("accessToken")}`; console.log("The config from $api.interceptors.request:", config) return config; }); export default $api; Next create…

VIEW QUESTION
Back To Top
Search