Datastore

So far, you’ve used App Engine to deploy a server. You’ve seen an example that uses servlets to generate content on the server with Java.


This is a companion discussion topic for the original entry at https://happycoding.io/tutorials/google-cloud/datastore

Hi,

With respect to this sentence:

To fix this, you could set your authentication so you local code connects to your live server’s Datastore, but chances are that’s not what you really want to do.

I actually do want to connect to my live server’s datastore. Do you have an example of how to do that?
I’m running java 11 app engine with legacy APIs enabled and we use cloud firestore in datastore mode.
I do not want to have to run the local emulator as our data setup jumps through quite a few hoops, so it would actually be a lot easier to connect to our live server when developing locally. This would grealty speed up full-stack development because we wouldn’t have to deploy a backend to have our frontend connect to.

Thank you

It’s been a while since I’ve used Google Cloud, so I don’t know how to connect to your prod Datastore off the top of my head. I found these related posts:

They suggest running this command:

gcloud beta auth application-default login

I haven’t actually tried that myself, so let me know if that helps at all.