I\'m still having problems with CORS when using Firebase HTTP functions.
Here is my web console error:
Response to preflight request doesn\'t pass ac
According to the Firebase documentation, there are a couple of references to CORS configuration:
Using CORS:
You can enable the use of CORS by calling it within the function, just like you did in your update to the question:
// Usage of the `cors` express middleware
return cors(req, res, () => {
// TO-DO
});
Also if you have an already existing Express app, you can then enable CORS by doing:
const app = express();
app.use(cors({ origin: true }));
This is what you had already done on the first step, but there's the difference in the { origin: true }
definition, so maybe that is related.
In any case, as per the documentation it looks like it is indeed fine to add the cors
within the request.