Help : call backend response to frontend

Backend script:
import {fetch} from ‘wix-fetch’ ;

export function EncryptedUrl() {
return fetch(url, {method: “GET” ,
headers:{
‘Authorization’ : 'Bearer xxxxx ,
‘Content-Type’ : ‘application/json’
}
})
.then(response => response.text())
.then( function (response){
console.log(response);
return response; //response carries url which need to be used in frontend for reloading page
});
}

frontend:
import {EncryptedUrl} from ‘backend/filename.jsw’
export function onclick(event){

wixLocation.to(link)
//How can i get the response i got in the backend to front end in link???

}

can some one please help

Hi Sailu,

If you need assistance learning how to call backend functions on the frontend you should check out the following article. This should help you out.

Corvid Web Modules: Calling Server-Side Code from the Front-End

Hope this helps!

Dara | Corvid Team