[Vuejs]-How to deploy Vue.js 2 app and Laravel 5.4 API on the same hosting

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/',
});

Leave a comment