Created
February 28, 2024 14:02
-
-
Save scriptpapi/8f03213ba3a9de7aaf9261f37ebc9c1c to your computer and use it in GitHub Desktop.
Sample firebase endpoint ready to go
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
const { onRequest } = require("firebase-functions/v2/https"); | |
const { setGlobalOptions } = require("firebase-functions/v2"); | |
const { default: axios } = require("axios"); | |
setGlobalOptions({ maxInstances: 10 }); | |
const cors = require('cors')({ origin: true }); | |
exports.sample = onRequest(async (request, response) => { | |
cors(request, response, async () => { | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment