Skip to content

Instantly share code, notes, and snippets.

@taishikato
Last active August 16, 2020 18:47
Show Gist options
  • Save taishikato/3473dc22a15327127189743acdfe8485 to your computer and use it in GitHub Desktop.
Save taishikato/3473dc22a15327127189743acdfe8485 to your computer and use it in GitHub Desktop.
How to use CORS with TypeScript on Firebase Cloud Functions πŸ”₯
import * as cors from 'cors';
const corsHandler = cors({origin: true});
export const createPaymentIntent = functions.https.onRequest((req, res) => {
corsHandler(req, res, () => {
res.send('Success');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment