Framework7 and Laravel API

I am new to APIs and Framework 7. Currently i am working on a project with laravel as API and framework7 and my frontend on my localhost. i have two main questions

Question 1 : Let say i am done with this project and i want to move it to a live server, how do i change all the localhost api urls to the live server urls?

Question 2 : How do i make a request to my endpoint together with the bearer token or other headers?

Changing localhost to your production server shouldn’t be that hard. My suggestion would be to declare a global variable at the start of your code, which you can edit once and change all the URLs together

var currentUrl = "localhost"; // change to your production URL

var urlToUse = "https://" + currentUrl + "/path/to/object" // would return 'https://localhost/path/to/object'
1 Like