Skip to content

Instantly share code, notes, and snippets.

@jobsamuel
Last active July 9, 2017 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jobsamuel/ace5b9c4b167040e75e11acf978ddc8f to your computer and use it in GitHub Desktop.
Save jobsamuel/ace5b9c4b167040e75e11acf978ddc8f to your computer and use it in GitHub Desktop.
const functions = require('firebase-functions');
const admin = require('firebase-admin');
// Aquí ocurre la magia de las variables de entorno:
const token = functions.config().variable.key;
exports.ejemploVariableDeEntorno = functions.https.onRequest((req, res) => {
if (req.method === 'GET') {
res.send(`Tu variable de entorno es ${token}`);
} else {
res.send(400).end();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment