Last active
July 9, 2017 15:07
-
-
Save jobsamuel/ace5b9c4b167040e75e11acf978ddc8f to your computer and use it in GitHub Desktop.
Revisions
-
jobsamuel revised this gist
Jul 9, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ 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) => { -
jobsamuel created this gist
Jul 9, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ const functions = require('firebase-functions'); const admin = require('firebase-admin'); 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(); } });