logo
Search
showing results for - "axios default baseurl conditional environment"
Angelo
09 Feb 2017
1import axios from 'axios'
2window.axios.defaults.headers.common = {'X-Requested-With': 'XMLHttpRequest'}
3window.axios.defaults.baseURL = (process.env.NODE_ENV !== 'production') ? 'http://localhost:9000/api/' : ''
source
similar questions
axios post with headerusing axios send a get request to the address 3aaxios set authorization headeraxios post urlencodedaxios post request with custom headersaxios get array of urlsmaking axios call with headersaxios configure base urlsetting axios base url dynamicallyaxios display nested json console logaxios defaults headers commonaxios forwardpass header in axiosaxios refresh tokenaxios get with headers
queries leading to this page
axios change default baseurlchange axios instance baseurlaxios defaults baseurlaxios baseurl defaultaxios default baseurlaxios default baseurlhow to change baseurl axios on production axios default baseurl conditional environmentaxios default baseurl conditional environment
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue