When I write this in the console in the devtools:
const response = await fetch("http://localhost:5001/api/products", {
headers: {"Content-Type":"application/json"}
});
const products = await response.json();
I am able to successfully get the data.
But when I run my node project with the same code in a JS file I get the following error:
Uncaught SyntaxError: Unexpected reserved word
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…