Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

axios default baseurl conditional environment

import axios from 'axios'
window.axios.defaults.headers.common = {'X-Requested-With': 'XMLHttpRequest'}
window.axios.defaults.baseURL = (process.env.NODE_ENV !== 'production') ? 'http://localhost:9000/api/' : ''
Source by github.com #
 
PREVIOUS NEXT
Tagged: #axios #default #baseurl #conditional #environment
ADD COMMENT
Topic
Name
3+8 =