Your backend application runs on a different domain than your client application?
That causes the CORS header ‘Access-Control-Allow-Origin’ missing error because basically your client-side is not authorized to access your backend using its domain.
Add cors headers in your first middleware in the backend.
you can set a header of
Access-Control-Allow-Origin: '*'
to allow any origin to access the backend.
Or setting your specific domain to allow only it to access your backend.
Access-Control-Allow-Origin: 'https://example.com'
Where https://example.com is the domain of your client side application.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…