-
Notifications
You must be signed in to change notification settings - Fork 598
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
Implement RemoteAPI for Node #1328
Comments
I might misunderstand, but we support connecting to both the remote API and localhost as well. I know you've been connecting to the emulator, so you already know how to do that. To connect to the remote API, just unset the Datastore emulator environment variable, and make sure to provide a keyFilename with a path to your key file. |
I have my nodejs directory which looks something like this:
Inside of my app.js file I have the following code:; var options = {
projectId: 'mydatastoreproject'
}
var keyFile = './mydatastoreprojectsandbox-5265e25422c.json';
if (keyFile) {
options.keyFilename = keyFile;
}
var datastore = gcloud.datastore(options); I am running this from my local computer. I want my local computer to be able to connect to the Google Cloud Datastore (not the local emulator). In my developer console I have enabled Google Datastore API. I created a KIND in the developer console and created one entity. I have also created credentials (service account key) in the form of a json file. I then included this json file in my code. By doing this I am still unable to connect to the datastore. Am I missing something or doing something wrong? Essentially all I want to do is to have my local machine connect to the Google Datastore. |
When you start the local datastore and it prints out "Set these environment variables", did you do that? Is that how you've been connecting to your local Datastore so far? By default, gcloud-node tries to talk to the remote API and assumes there is no emulator running. It has to be told to talk to the emulator, which can be done via the env var ( |
ahhhhh yes I had this variable set. All works now thanks! |
No problem, glad that it works now! |
how to run on pcf |
How will I be able to use the datastore emulator without the key.json for nodejs? |
I'd like to be able to connect to the datastore from any NodeJS application including my local. It would be great if the gcloud-node had the RemoteAPI implemented such as python(https://cloud.google.com/appengine/docs/python/tools/remoteapi).
The text was updated successfully, but these errors were encountered: