Problem creating an export function

VN,

I appreciate your input, but it doesn’t address the inconsistency in the way my IDE works versus that demoed in the Back End video course.

I had already confirmed that my back end code worked by importing it to the front end.

Moving on to the next lesson, I find that the URL in the following code taken from the video returns an error that appears to be permissions based instead of the promised JSON data of the planets. In this instance, the IDE did perform as demoed in the video course.

import { fetch } from ‘wix-fetch’ ;

export async function fetchPlanets ( ) {
const settings = {
method : ‘GET’ ,
headers : {
Accept : ‘application/json’
}
};
try {
const fetchResponse = await fetch ( ‘https://www.explorevelo.com/_functions/listAllPlanets’ , settings );
const data = await fetchResponse . json ();

    **return**  data ; 
}  catch  ( e ) { 
    **return**  e 
} 

}