vendredi 22 janvier 2021

How to fix redirects frontend url and api url in laravel?

I need help making a redirect. I am working on a project that the front-end reactjs and the back-end laravel are in different domains. The system has file registration and they are stored in the spaces of the digital ocean. When the system returns the file url, the returned url is concatenating the front-end base url with the file url in spaces, example:

http://localhost:8000/http://localhost:3000

In web routes:

Route::any('/', function () {
    header('Location: ' . env('APP_FRONTEND_URL'));
    die;
});

How to fix redirects?




Aucun commentaire:

Enregistrer un commentaire