Enable Cors in Firebase Cloud Function

后端 未结 2 1357
囚心锁ツ
囚心锁ツ 2020-12-10 16:55

I have written some cloud functions and deployed them now i am trying to hit those APIs using my Angular application but i am getting this error

Acces

2条回答
  •  轮回少年
    2020-12-10 17:41

    On server side try this: npm install cors. Then const cors = require('cors')({origin: true}); Maybe this link will help you: Enabling CORS in Cloud Functions for Firebase Also you can disable CORS rules in browser using plugin, for example in crome: https://chrome.google.com/webstore/detail/allow-control-allow-origi/nlfbmbojpeacfghkpbjhddihlkkiljbi?hl=en

提交回复
热议问题