Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for exporting to GCloud Functions / Firebase Functions #76

Merged
merged 15 commits into from
Nov 4, 2022

Conversation

kamilafsar
Copy link
Contributor

Before this change you could only create an export for NodeJS. This PR makes makes the export compatible with GCloud Functions / Firebase Functions. Because we now have 2 "flavors" for the export, we added a new flag "--flavor" to the export command.

To create a NodeJS compatible export:

npx phero server export --flavor nodejs

To create a GCloud Functions / Firebase Functions compatible export:

npx phero server export --flavor gcloud-functions

These will output an "export" directory in your project directory. In it, you will find a directory for each service you've defined in your phero.ts file.

To run the NodeJS exported services:

node ./export/helloWorldService/index.js

To deploy a services to Firebase/GCloud, you should run:

gcloud functions deploy helloWorldService 
    --trigger-http 
    --runtime nodejs16 
    --entry-point helloWorldService 
    --source "./export/helloWorldService"

For every service we will export a different bundle. We will of course document all this in docs after release.

Copy link
Contributor

@JasperH8g JasperH8g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, as always 😊

packages/dev/src/cli/commands.ts Outdated Show resolved Hide resolved
packages/dev/src/cli/commands.ts Outdated Show resolved Hide resolved
@kamilafsar kamilafsar changed the base branch from main to develop November 4, 2022 15:48
Copy link
Contributor

@JasperH8g JasperH8g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

@kamilafsar kamilafsar merged commit 4e1fe9c into develop Nov 4, 2022
@kamilafsar kamilafsar deleted the feature/firebase-integration branch November 4, 2022 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants