I'm trying to deploy a firebase cloud function with cors but it doesn't work. This is my code bellow, can someone help me with this ?
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import * as cors from 'cors'
admin.initializeApp()
const corsHandler = cors({origin: true})
export const getUser = functions.https.onRequest((request, response) => {
    corsHandler(request, response, () => {})
    admin.firestore().doc("profiles/T0XCPHPkrJM4I10okb9KSHyukqn1").get()
    .then(snapshot => {
        const data = snapshot.data()
        console.log(data)
        response.send(data)
    })
    .catch(error => {
        console.log(error)
        response.status(500).send(error)
    })
})
 
    