I have my nodejs directory which looks something like this:
MyApp
-app.js
-mycredetnials.json
-package.json
+node_modules
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.