Last active
November 29, 2017 13:24
-
-
Save jthegedus/a08770329aa9f87f4f1c18c22c0629b0 to your computer and use it in GitHub Desktop.
ES6+ in Cloud Functions for Firebase - preset-2015 with async/await (not getting compiled)
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
// Babel output - with Babel REPL settings: | |
// * preset-es2015 | |
"use strict"; | |
var functions = require("firebase-functions"); | |
var message = function message() { | |
return new Promise(function(resolve) { | |
setTimeout(function() { | |
resolve("from Babelified Cloud Functions!"); | |
}, 5000); | |
}); | |
}; | |
module.exports.helloWorld = functions.https.onRequest(async function(req, res) { | |
var world = await message(); | |
res.status(200).send("Hello " + world); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment