CORS Error: “requests are only supported for protocol schemes: http…” etc CORS Error: “requests are only supported for protocol schemes: http…” etc express express

CORS Error: “requests are only supported for protocol schemes: http…” etc


XMLHttpRequest cannot load localhost:4201/ticker. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.

Any time you see that “only supported for protocol schemes” message, it almost certainly means you’ve just forgotten to put the https or http on the request URL in your code.

So in this case, the fix is to use the URL http://localhost:4201/ticker in your code here:

this._baseUrl = 'http://localhost:4201/';

…because without the http:// there, localhost:4201/ticker isn’t really the URL you intend.