-
Notifications
You must be signed in to change notification settings - Fork 108
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
Flag to point to alternative baseUrl when running locally with Functions Framework #493
Comments
👋 @quantuminformation I'm not too familiar with FF but for emulator usage we usually suggest setting either the |
This is my output of the emulator, does it look correct? ➜ gcp-datastore-cloud-functions-realworld-example-app git:(master) ✗ gcloud beta emulators datastore env-init |
I think so, I'm pretty sure the only env var the client respects is |
Perfect looks like it worked, will make a youtube video to help others soon
|
I think we might have an actual issue here when the "DATASTORE_EMULATOR_HOST" variable is in this format: "::1:8766". Our code was expecting something more like "http://localhost:8081". @quantuminformation, did something get removed somehow from the original "DATASTORE_EMULATOR_HOST" value you shared, or is it really "::1:8766"? |
Yeah thats a bug, I saw when updating the cli today |
Your current Cloud SDK version is: 259.0.0 ┌────────────────────────────────────────────────────┐ before it was:
|
Not sure if I broke smth locally though, opened another terminal and same issue |
Ah, nice that it was caught! All you should need to do, then, is start the emulator, set the env var, and the Datastore lib will figure it out.
The issue where the emulator wants you to set "::1:8766", or @google-cloud/datastore can't detect that it should connect to the emulator? |
The issue where the emulator wants you to set "::1:8766", It confused me for a few mins that one |
That is strange. @JustinBeckwith -- is there a way we can pass this confusion along to the relevant team, and maybe see if the new output format is deliberate and something we'd need to support? |
That's super strange. @stephenplusplus can you start an email thread with me and Ben? |
what have I started.... ) |
That looks like an ipv6 loopback address equiv to localhost. https://stackoverflow.com/questions/40189084/what-is-ipv6-for-localhost-and-0-0-0-0 |
#502 can take over for this issue, regarding supporting IPv6 addresses. |
Reposted from GoogleCloudPlatform/functions-framework-nodejs#87
I import the following in my cloud functions and am trying to run it all locally with the functions framework
ds: require('@google-cloud/datastore')(),
By default ds.baseUrl_ is "datastore.googleapis.com", but when running
gcloud beta emulators datastore
the local store is athttp://localhost:8766/
my scripts which fire up both emulation:
How do I update this baseUrl_ when running with FF?
The text was updated successfully, but these errors were encountered: