Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

nuxt axios middleware

export default function ({ $axios, redirect }) {
  $axios.onError(error => {
    if(error.response.status === 500) {
      redirect('/sorry')
    }
  })
}
 
PREVIOUS NEXT
Tagged: #nuxt #axios #middleware
ADD COMMENT
Topic
Name
4+3 =