0👍
✅
Assuming your web server is listening on port 80, you only need to supply the path in the url like:
axios.post(`/api/requests`, {
'fname': this.fname,
'lname': this.lname,
'email': this.email,
'phone': this.phone
})
You can set a default configuration to set the base url and port if needed:
var instance = axios.create({
baseURL: 'https://some-domain.com:8000/api/',
});
Source:stackexchange.com