2

At first I have a Java-Module set up in AndroidStudio that I upload to my GoogleAppEngine server which works pretty good. (Android Studio - Build -Deploy Module to Google App Engine)

Now I also want to upload an additioanl node.js server to the same App Engine instance. The code shall also access the firebase databases, that were created in the Java module. To uplaod the node.js code I followed Googles QuickStart tutorial using gcloud app deploy.

As I know this creates a new version in the backends flex environment disabling my existing Java Code.

So my questions is: How can I add a node.js server to my existing Instance? I guess I have to do this within the Android Studio project then but not within gcloud app deploy. How can I create a new module such that the node.js server is available on a subfolder then for instance?

softwaresupply
  • 1,908
  • 3
  • 20
  • 34
  • Please clarify what you mean by "instance". Is it a GAE instance (as in what's billed in instance-hours) or do you actually mean the GAE app? – Dan Cornilescu Feb 23 '17 at 13:32
  • I mean the GAE instance. To be more specific when you upload the Java code, you can see a new Java-version in the GAE-backend under "Versions". If I then deploy via gcloud-command I see a new node-Version under "Versions" which is active than. This means the Java-version visible is not active anymore. What I want to achieve is to upload the code within one version such that both code-parts are active. I think I must include the node.js stuff in the Java projects folder and reference them maybe via the web.xml deployment descriptor. But I couldn't figure out how to do that. – softwaresupply Feb 23 '17 at 14:00

1 Answers1

1

You won't be able to "upload an additional node.js server to the same App Engine instance" because it's a different language (and environment), thus they can't be in the same service/module (an instance can only execute code from one module).

You need to name the services/modules differently so that they don't overwrite each-other at deployment time. After that they can be deployed independently.

Check your service: configuration in the node.js modules's app.yaml file. From General settings:

service: service_name

Required if creating a service. Optional for the default service. Each service and each version must have a name. A name can contain numbers, letters, and hyphens. It cannot be longer than 63 characters and cannot start or end with a hyphen. Choose a unique name for each service and each version. Don't reuse names between services and versions.

Note: Services were previously called "modules."

And your module and/or service configs in your java module's appengine-web.xml file.

See also Microservices Architecture on Google App Engine

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
  • "You need to name the services/modules differently so that they don't overwrite each-other at deployment time" - Does that mean they are then online at the same time and especially the node code still is able to access the firebases databases that are accessed in the Java environment as well? Can you provide a link that explains how that module is defined? Thx! – softwaresupply Feb 23 '17 at 14:30
  • Yes, they work together. See links in updated answer. – Dan Cornilescu Feb 23 '17 at 15:38