I wrote a function that receives my list from the server (NODEJS) in the REACT language
getList = () => {
const request = new Request('http://localhost:3000/api/get');
fetch(request, {method: 'GET',mode: 'no-cors',
})
.then((response) => console.log("response", response.JSON()));
}
The request is being made but the returned value I receive in CONSOLE.LOG is:
response Response {type: "opaque", url: "", redirected: false, status: 0, ok:
false, …}body: (...)bodyUsed: falseheaders: Headers {}ok: falseredirected: falsestatus:
0statusText: ""type: "opaque"url: ""__proto__: Response
This is the code on the server:
const MyList=[
{id:1,name:'to do list'},
{id:2,name:'to sleep'},
]
app.get('/api/get',(req,res)=>{
res.send(MyList);
});
Where is the values of the list returned from the server ???