https://github.com/zetavg/google-functions-nodejs-template
A template for writing Google Cloud Function with Node.js, TypeScript, Babel, ESLint, and Prettier.
https://github.com/zetavg/google-functions-nodejs-template
google-cloud-functions nodejs typescript
Last synced: 9 months ago
JSON representation
A template for writing Google Cloud Function with Node.js, TypeScript, Babel, ESLint, and Prettier.
- Host: GitHub
- URL: https://github.com/zetavg/google-functions-nodejs-template
- Owner: zetavg
- Created: 2021-06-05T13:46:38.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-06-07T04:52:06.000Z (over 4 years ago)
- Last Synced: 2025-04-01T22:59:54.519Z (9 months ago)
- Topics: google-cloud-functions, nodejs, typescript
- Language: TypeScript
- Homepage:
- Size: 190 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Google Cloud Function Node.js Template
A template for writing Google Cloud Function with Node.js, TypeScript, Babel, ESLint, and Prettier.
## Setup
```sh
npm install
```
## Run Locally
```sh
npm start
```
## Deploy
### Deploy to Google Cloud Functions
Simply deploy the function from your local machine with the [`gcloud` command-line tool](https://cloud.google.com/functions/docs/quickstart) by running:
```sh
REGION=[SET_GCLOUD_REGION] FUNCTION_NAME=[NAME_YOUR_FUNCTION_ON_GCLOUD] npm run deploy-gcloud
```
### Get a Uploadable ZIP File
```sh
npm run build-zip
```
### Build a Deployable Container
You will need to install [Docker](https://store.docker.com/search?type=edition&offering=community) and the [`pack` tool](https://buildpacks.io/docs/install-pack/), then run:
```sh
npm run build-container
```
After that, you'll be able to start the built container with:
```sh
docker run --rm -p 8080:8080 my-function
```