0👍
res.end() is intended for ending the response without data (see https://expressjs.com/en/api.html).
If you want to return json, the easiest way is to use res.json():
app.get('/sources', function (req, res) {
res.set({
'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Methods': 'GET'
});
let data = getNews.getSources()
res.json(data);
});
- [Vuejs]-How to use Vue JS transition "inside" another transition?
- [Vuejs]-Access to XMLHttpRequest blocked by CORS policy Error
0👍
I found the problem, it’s a security thing with ios, they don’t allow http calls, only https (I run the project on an ios emulator)
Source:stackexchange.com