Last active
July 9, 2017 15:07
-
-
Save jobsamuel/ace5b9c4b167040e75e11acf978ddc8f to your computer and use it in GitHub Desktop.
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 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