Skip to content

Instantly share code, notes, and snippets.

@1206yaya
Last active August 31, 2023 21:00
Show Gist options
  • Save 1206yaya/06cb8603ffd831f78ef572df7474e008 to your computer and use it in GitHub Desktop.
Save 1206yaya/06cb8603ffd831f78ef572df7474e008 to your computer and use it in GitHub Desktop.
Firebase Cloud Functions
import * as admin from "firebase-admin"
import * as functions from "firebase-functions"
import * as logger from "firebase-functions/logger"
import * as firestore from "@google-cloud/firestore"
// This file: https://gist.github.com/1206yaya/06cb8603ffd831f78ef572df7474e008
// const SECRET_NAME = defineString('SECRET_NAME');
// https://firebase.google.com/docs/functions/typescript
export const helloWorld = functions.https.onRequest((request, response) => {
logger.info("Hello logs!", { structuredData: true });
response.send("Hello from Firebase! " + " " + process.env.foo);
// response.send("Hello from Firebase! SECRET_NAME: " + SECRET_NAME.value() + " " + process.env.foo);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment