jeudi 18 avril 2019

How can i manage axios ajax url for deploying my Laravel project on shared host

I had developed a Laravel app in which i used vuejs and axios for ajax and its working good at my working machine but when i deployed it on shared hosting my ajax routes mean Api routes got not found because i changed some directory.



methods:{
                getSearch:function () {
                    var app = this;
                    app.resultsShow = false;
                    app.searching = true;

                    if(app.searchBox === ''){
                        app.searching = false;
                        app.resultsShow = false;
                    }else{
                        clearTimeout(app.timeout);

                        // Make a new timeout set to go off in 800ms
                        app.timeout = setTimeout(function () {
                            axios.post('/api/searchPlace', {
                                dd:app.searchBox,
                            })
                                .then(function (response) {
                                    app.searching = false;
                                    app.resultsShow = true;
                                    app.results = response.data;

                                    console.log(app.results);
                                })
                                .catch(function (error) {
                                    console.log(error);
                                });

                        }, 500);

                    }

                }
            }


enter image description here



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire