Answer the question
In order to leave comments, you need to log in
How to pass axios baseURL vue3?
Good afternoon.
Created vue3 project.
How to pass baseUrl, so that it would not be constantly registered in functions, but only 1 time somewhere?
I understand somehow in the vue.config.js file?
Now I use by type
const url = 'http://localhost:1234/api/example'
axios
.post(url, data)
.then(() => {
});
export default {
env: {
backendUrl: 'http://localhost:5034/',
},
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question