Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Functions, Node JS 8.9.x (LTS) and KOA library

How can I use Koa library, the express replacement, in Cloud Functions?

I know KOA use all great ES2017 and make more use of Async use of JavaScript.

or it might not be needed at all working with Cloud Functions because the Firebase system won't send multiple calls to the same Cloud Function until it ends the previous one?

it unclear to me.

it know demands Node 8.x and I know the NodeJs 8.9.x, has now LTS.

like image 438
Nisim Joseph Avatar asked Dec 08 '17 10:12

Nisim Joseph


1 Answers

Reading from cloud functions doc:

Base Image Cloud Functions uses a Debian-based execution environment and includes contents of the gcr.io/google-appengine/nodejs Docker image, with the Node.js runtime installed in the version, specified above:

FROM gcr.io/google-appengine/nodejs
RUN install_node v6.14.0

To see what is included in the image, you can check its GitHub project, or pull and inspect the image itself. Updates to the language runtime (Node.js) are generally done automatically (unless otherwise notified), and include any changes in the definition of the base image.

And I saw a pull request back in November 2017, adding Nodejs v8. Here's hoping it can finally land in Google Cloud Functions 🤞🏻

UPDATE: Google Cloud Functions now support Node.js 8 and even Python!

like image 158
chriz Avatar answered Oct 09 '22 16:10

chriz