usage nuxt axios in middleware code example
Example: nuxt axios middleware
export default function ({ $axios, redirect }) {
$axios.onError(error => {
if(error.response.status === 500) {
redirect('/sorry')
}
})
}
export default function ({ $axios, redirect }) {
$axios.onError(error => {
if(error.response.status === 500) {
redirect('/sorry')
}
})
}