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

Update README with some basic run / deploy commands #51

Open
wstrange opened this issue Sep 29, 2019 · 1 comment
Open

Update README with some basic run / deploy commands #51

wstrange opened this issue Sep 29, 2019 · 1 comment

Comments

@wstrange
Copy link

As a nodejs newbie, I'm a little lost on the run / deployment model.

a) How do I run this with node?
b) Does this work with the firestore emulator? Any tips?

@wstrange
Copy link
Author

Doing some experimenting, this is what worked for me:

To initialize the app, the following is sufficient:

final admin = FirebaseAdmin.instance;
final app = admin.initializeApp();

Note that it is not required to pass in the service account json, or the URL of the emulator, provided you do the following:

To run against the "real" firestore, set the following env var:

export  GOOGLE_APPLICATION_CREDENTIALS=path/to/your/service_account.json
# Run your compiled app
node build/node/my_admin_app.dart.js

To run against the emulator (assume it is running firebase emulators:start), make sure the previous variable is unset, and intead set:

export FIRESTORE_EMULATOR_HOST=localhost:8080
node build/node/my_admin_app.dart.js

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

No branches or pull requests

1 participant