Last active
October 24, 2019 23:56
-
-
Save lexyblazy/c8cc7d5eb128650c164cec042150d2b1 to your computer and use it in GitHub Desktop.
Firebase admin initialized
This file contains 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
import * as firebaseAdmin from "firebase-admin"; | |
import * as functions from "firebase-functions"; | |
import express from "express"; | |
import * as serviceAccount from "./serviceAccount.json"; | |
const app = express(); | |
const firebase = firebaseAdmin.initializeApp({ | |
credential: firebaseAdmin.credential.cert({ | |
projectId: serviceAccount.project_id, | |
clientEmail: serviceAccount.client_email, | |
privateKey: serviceAccount.private_key | |
}), | |
databaseURL: <YOUR_DATABASE_URL> | |
}); | |
app.get("/", (req: express.Request, res: express.Response) => { | |
res.send("Now we are live with the express server"); | |
}); | |
export const v1 = functions.https.onRequest(app); |
This file contains 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
Show hidden characters
{ | |
"compilerOptions": { | |
"module": "commonjs", | |
"noImplicitReturns": true, | |
"noUnusedLocals": true, | |
"outDir": "lib", | |
"sourceMap": true, | |
"strict": true, | |
"target": "es2017", | |
"resolveJsonModule": true // add this line to resolve json modules | |
"esModuleInterop" : true // add this for common js module resolution | |
}, | |
"compileOnSave": true, | |
"include": ["src"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment