Project template for spinning up express powered cloud functions written in TypeScript and deployed via circleci.
- Clone the repository
git clone --depth=1 https://github.com/StefanKjartansson/ts-express-cloud-function-template.git <project_name>
- Install dependencies
cd <project_name>
yarn install
- Update package.json with <project_name> and related information.
- Write code
- In GCP, enable cloud functions for your project
- Export service account key with cloud function developer permissions
- Configure project in circleci and add the following environment variables:
GCP_AUTH=Value should be base64 encoded service account key "base64 <your-service-account.json>"
GCP_PROJECT=Your project id from GCP.
GCP_FUNCTION=The name of the function in GCP.
- Push change and circle should deploy your function.
- When calling your function, remember to append a slash to the path