Skip to content

Latest commit

 

History

History
46 lines (33 loc) · 1.27 KB

README.md

File metadata and controls

46 lines (33 loc) · 1.27 KB

@nx-extend/gcp-functions

@nx-extend/gcp-functions NPM package

Nx plugin to build and deploy your Google Cloud Functions.

Setup

Install

npm install -D @nx-extend/gcp-functions
nx g @nx-extend/gcp-functions:init

Usage

Deploy

Available options:

name type default description

Runner

This projects includes a runner to run all your functions, to generate the runner:

nx g @nx-extend/gcp-functions:init-runner <name>

This will generate a main.ts file like this:

import { bootstrapRunner } from '@nx-extend/gcp-functions/runner'

/* eslint-disable @nx/enforce-module-boundaries */
bootstrapRunner(new Map([
    ['nx function project name', import('path to main of of project')]
  ])
)

You can now add all your functions to the map, note: make sure that the nx function project name is the same name as known by Nx (name prop of that functions project.json). The runner uses the deploy target of that project.json to determine how to serve the function (http/pub sub/bucket event).