Skip to content

A template for building and deploying functions in Typescript on Google Cloud with tests

License

Notifications You must be signed in to change notification settings

jgunnink/typescript-cloud-function-template

Repository files navigation

Cloud Functions Typescript Template

This repo is to help get building faster with typescript on Google Cloud Functions.

It includes:

  • Pre built tests using mocha and chai to get started easily.
  • Hosting the function locally on port 8080.
  • Cloudbuild yaml file for easy integration to continuous delivery if required.
  • Github Actions for testing and branch status checks on PR merges.

Requires Node v20 or higher.

Usage

Local hosting

npm start will kick up the server and host your code on port 8080.

You can then run something like:

curl -X POST -H "Content-Type: application/json" \
    -d '{"message": "Hello my friend"}' \
    http://localhost:8080

To see how your function would respond once deployed.

Testing

npm test will run all tests in the /tests folder.

About

A template for building and deploying functions in Typescript on Google Cloud with tests

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published