Skip to content

A template for writing Google Cloud Function with Node.js, TypeScript, Babel, ESLint, and Prettier.

Notifications You must be signed in to change notification settings

zetavg/google-functions-nodejs-template

Repository files navigation

Google Cloud Function Node.js Template

A template for writing Google Cloud Function with Node.js, TypeScript, Babel, ESLint, and Prettier.

Setup

npm install

Run Locally

npm start

Deploy

Deploy to Google Cloud Functions

Simply deploy the function from your local machine with the gcloud command-line tool by running:

REGION=[SET_GCLOUD_REGION] FUNCTION_NAME=[NAME_YOUR_FUNCTION_ON_GCLOUD] npm run deploy-gcloud

Get a Uploadable ZIP File

npm run build-zip

Build a Deployable Container

You will need to install Docker and the pack tool, then run:

npm run build-container

After that, you'll be able to start the built container with:

docker run --rm -p 8080:8080 my-function

About

A template for writing Google Cloud Function with Node.js, TypeScript, Babel, ESLint, and Prettier.

Topics

Resources

Stars

Watchers

Forks