I’m currently learning how to use new Cloud Functions for Firebase and the problem I’m having is that I can’t access the function I wrote through an AJAX request. I get the “No ‘Access-Control-Allow-Origin'” error. Here’s an example of the function I wrote:
exports.test = functions.https.onRequest((request, response) => {
response.status(500).send({test: 'Testing functions'});
})
The function sits in this url:
https://us-central1-fba-shipper-140ae.cloudfunctions.net/test
Firebase docs suggests to add CORS middleware inside the function, I’ve tried it but it’s not working for me: https://firebase.google.com/docs/functions/http-events
This is how I did it:
var cors = require('cors');
exports.test = functions.https.onRequest((request, response) => {
cors(request, response, () => {
response.status(500).send({test: 'Testing functions'});
})
})
What am I doing wrong? I would appreciate any help with this.
UPDATE:
Doug Stevenson‘s answer helped. Adding ({origin: true}) fixed the issue, I also had to change response.status(500)
to response.status(200)
which I completely missed at first.
buy modafinil online – modafinil and caffeine provigil a narcotic
accutane order online – purchase accutane with paypal order accutane online
amoxil 500mg – amoxicilin without prescription buy amoxicilin online
order vardenafil 10 pills – buy vardenafil online usa 40mg generic vardenafil
ivermectin generic name – ivermectin 0.1 uk stromectol price uk
cialis pill generic – best price for tadalafil average price of cialis 20mg
cost of ivermectin 1% cream – ivermectine
hydroxychloroquine side effects heart https://plaquenilx.com/# hydroxychloroquine for malaria
buy generic accutane online cheap – where to get accutane uk rx costs accutane
lyrica 150 mg capsule – drugs from canada canadian pharmacy price checker
amoxicillin 500mg capsules – amopills.com amoxicillin without a doctor’s prescription
hydroxychloroquine side effects eye https://plaquenilx.com/# plaquenil drug class
cheap generic viagra from india – can you buy viagra over the counter in australia viagra online australia
cost for tadalafil – where to buy cialis pills cialis online in canada
ivermectin india – stromectol coronavirus stromectol ivermectin buy
prednisone 473 – buy prednisone online usa prednisone 20 mg tablet cost
modafinil adhd – modafinil anxiety provigil
buy generic zithromax online – zithromax online what is azithromycin prescribed for
lasix 40mg – furosemide 80 lasix tablets 20 mg
purchase clomid – clomid online buy clomid online
online pharmacy indonesia – cialis brand buy cialis without presc
hydro chloroquine https://plaquenilx.com/# long term side effects of plaquenil
ventolin generic price – gnrventolin.com ventolin price usa
566698 103605Hi, have you ever before asked yourself to write about Nintendo or PSP? 689017
how much is cytotec tablet – cytotec generic cytotec 200mg tablet
buy doxycycline online usa – doxycycline cheap doxycycline 100mg price south africa
neurontin 1800 mg – neurontin cap 300mg 137 mg synthroid
buy viagra online in india – viagra for sale online usa
cialis india order – cialis 2.5 mg price
buy vardenafil now – vardenafil order prescription buy vardenafil viagra
where can i get accutane cheap – accutane online prescription cost how to get cheap accutane
buying amoxicillin over the counter – amoxicillin antibiotics without a doctor’s prescription
pay for assignments australia – essays on service write research papers
buy oral ivermectin – stromectol oral how much is ivermectin
lasix generic – buy clomid online no prescription cheap furosemide
buy ventolin online – ventolin uk price ventolin 100 mcg
cytotec 200mg – where to buy cytotec in south africa cytotec 200 mg price
doxycycline for sale usa – prednisolone 5mg coupon prednisolone tablets for sale
ivermectin lotion for scabies – ivermectin usa price buy stromectol online uk
stromectol online canada – where can i buy ivermectin ivermectin cream 1%
female sildenafil – sildenafil pill sildenafil cheap
tadalafil generic name – tadalafil 20 mg buy tadalafil online overnight shipping
help me with my essay – wressays.com research paper assistance
cheap viagra in us – Cialis on line purchase northern pharmacy canada
augmentin amoxicillin clavulanate
levitra 10 mg – online levitra what are ed drugs
buy propecia direct from india
methotrexate and plaquenil – hydroxychloroquine stock buy prednisone online no script
cenforce 50 usa and uk – site vidalista 60 side effects
prednisone prescription cost
orlistat medication coupon – orlistat dosis diaria xenical reviews
best canadian online pharmacy cialis
ivermectin uk – ivermectin order online ivermectin new zealand
tadalafil online script
tadalafil 20mg no prescription – cialis us generic cialis soft
prednisone uk price – prednisone 60 mg prednisone pills for sale
zithromax how much does it cost
how much is cialis daily use – tadalafil canada cheap cialis pills canada
ivermectin for humans walmart – buy stromectol for humans uk ivermectin 5 mg
stromectol coronavirus – stromectol buy buy stromectol europe
tadalafil cost – cialis 20 mg tadalafil lowest price
buy cialis online cheap uk – Cialis mail order usa female cialis australia
slots real money – casirealgam best online casino
buy priligy dapoxetine online
tadalafil tablets 20 mg online india
ivermectin online pharmacy – ivermectin 12mg for humans for sale ivermectin 20 mg
stromectol coupon – ivermectin 12 mg over counter stromectol generic
buy generic sildenafil in usa
prednisone 60mg daily – buy prednisone online cheap prednisone tablet cost
viagra 6 pills
prednisone 5mg coupon – prednisone 5mg without prescription prednisone for sale in canada
can you take azithromycin with digoxin – over the counter chlamydia treatment walgreens fast shipping zithromax
how to buy generic cialis online
purchase hydroxychloroquine online cheap – cenforce canada valacyclovir 500mg pills
fluconazole alcohol reddit
sildalis for sale online – sildalis pills buy glucophage sale
ampicillin 500mg usa – ampicillin ca buy plaquenil 200mg sale
sildenafil generic – cialis uk buy cialis 10mg generic
cat uti amoxicillin
viagra 50mg sans ordonnance en france – tadalafil 40mg sans ordonnance en france tadalafil 5mg generique en pharmacie
stromectol – cialis 10mg kaufen ohne rezept ivermectin tablet 1mg
prednisone 10mg for sale – is canadian pharmacy legitimate prednisone 5mg for sale
is amoxicillin 875 the same as augmentin
lyrica 150mg usa – clomiphene 50mg price buy zithromax 500mg pills
tadalafil generic tadalafil cost walmart
atarax 10mg generic – buy motilium online generic crestor
https://cialiswbtc.com/ cheapest tadalafil cost
where to order tadalafil tablets tadalafil dosage
inderal over the counter – inderal 20mg sale hydroxychloroquine 200mg price
brand chloroquine 250mg – viagra 150mg drug order sildenafil 100mg generic
https://cialisbusd.com/ canada generic tadalafil
tadalafil side effects cheap generic cialis for sale
cialis at canadian pharmacy tadalafil price walmart
cialis cost tadalafil liquid
tadalafil goodrx tadalafil price walmart
cialis tadalafil https://cialiswbtc.com/
darkmarket 2022 bitcoin dark web
dark web market dark web markets
bitcoin dark web tor dark web
darknet market deep web drug links
darknet market links deep web markets
darknet market links dark web drug marketplace
dark market dark market url
darknet market links tor market
tor darknet darkweb marketplace
dark market dark web drug marketplace
dark market onion darknet markets
tor markets 2022 tor markets links
dark web links dark web drug marketplace
dark web sites tor markets 2022
dark market onion deep web drug markets
dark web sites darknet drug market
onion market darknet marketplace
darknet markets dark web drug marketplace
dark market 2022 tor dark web
darkmarket link tor market links
darkmarket url best darknet markets
darkmarket url darknet websites
dark web link dark market list
dark markets darkmarket list
darkmarket 2022 dark market 2022
darkmarket 2022 dark web drug marketplace
darkweb marketplace tor market url
darkmarkets tor markets 2022
dark markets 2022 dark web sites
darkmarkets tor market
dark market onion deep web drug url
dark web markets deep web drug markets
darknet marketplace darkmarkets
tor markets links darknet market list
best darknet markets deep web drug store
darknet market tor darknet
darknet market list bitcoin dark web
darknet drug links darkmarket list
darknet drug links darknet drug market
darkmarket 2022 darknet drug store
darknet markets dark market url
dark market url dark market link
darknet drug links dark web links
tor marketplace darknet market
darknet market links deep web markets
darknet marketplace darkmarket
darknet websites tor dark web
darkmarket list tor markets
tor markets 2022 tor markets links
dark web link dark market
deep web drug url dark web sites
deep web drug markets dark web link
tor markets 2022 darknet websites
dark web sites tor markets 2022
deep web drug markets deep web drug markets
darknet drug market dark market onion
dark market 2022 tor darknet
tor darknet dark web sites
deep web drug url tor darknet
darknet market deep web drug store
darkmarket list tor marketplace
tor markets 2022 darknet market list
darkmarket dark market list
dark market 2022 dark market 2022
tor market dark markets
tor marketplace tor markets links