Home > Enterprise >  the search button is not working after I deploy
the search button is not working after I deploy

Time:05-18

[image1][1] The search button is not working after I deployed my website. but it is working in my local hosting. In the first picture, I can able to search for anything with the localhost on my computer and able to query any data I want. [1]: https://i.stack.imgur.com/jjyED.jpg But after I deploy the website in live server, the search features that I create is not working

enter image description here

CodePudding user response:

The deployed version is still pointing to the local version which is causing some CORS issues. You have to change this

const site_url = "http://127.0.0.1:8000/";

to this

const site_url = "http://test.wt-g.shop/";

for the deployed version.

Method 2

You can add this

<script>
    const site_url = "{{ url('/') }}";
</script>

to the head section of your root blade file so that you will not worry about the environment the app is working.

  • Related