Created
February 10, 2020 04:38
-
-
Save choipd/587ce9823856c05d15e0a73c80a4d35d to your computer and use it in GitHub Desktop.
cors in firebase functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// httpHelper에 아래와 같이 정의하고 | |
const corsRoutine = (req, res, func) => { | |
cors(req, res, () => { | |
func(req, res); | |
}); | |
} | |
// functions 구현할 때 corsRoutine으로 감싸서 쓰고 있습니다. | |
functions.https.onRequest((req, res) => httpHelper.corsRoutine(req, res, ()=>{ | |
// functions 구현 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment