0👍
configure your axios in main.js (entry point )
axios.create({
baseURL: process.env.VUE_APP_BASE_URL
})
Then directly call api ..it will append base url based on your env parameter
axios('/online-store/src/database_api/Admin/recent_product.php')
Note : Don’t forget to add .env as per environment
- [Vuejs]-Can get variable from secondary table in api on a list page, but not on single item page
- [Vuejs]-How can I submit only form elements in Vue[2].js?
Source:stackexchange.com