I've experimented with google cloud and have figured this out already. Folder structure is as follows:
<https://lh3.googleusercontent.com/-mI1wZbR9Gko/WbK9NaAx0JI/AAAAAAAAaek/Nz1XNYtNk9I1vKvPJMz7-l5zpE6KEPEXgCLcBGAs/s1600/structure.JPG> Now before you deploy declare an environment variable called "SERVICE_NAME: 'service-name-goes-here'" in your .yaml files. When you deploy you run: gcloud app deploy ./service-1.yaml ./service-2.yaml In package.json you setup the start script to use the launcher.js file. "scripts": { "start": "cross-env NODE_PATH=. NODE_ENV=production node launcher.js" } Inside launcher.js you write some code like this: const service = process.env.SERVICE_NAME; console.log("Starting service: " + service); switch (service) { case 'service-1': require('./service-1/main.js'); return; case 'service-2': require('./service-2/main.js'); return; default: console.error("Unrecognized SERVICE_NAME: " + service); process.exit(1);} Essentially what we have done is deployed ALL of the code for every service to the app engine, but the starting of the service is defined in launcher.js. So the service that will start is based on what the .yaml has defined SERVICE_NAME as. This has worked for me and I have 5+ services sharing common modules. On Wednesday, September 6, 2017 at 4:52:21 PM UTC-4, Robie Ie wrote: > > I have a project setup as follows: > > /root-folder -- > /common-code > /service-1 -- > /code > /app.yaml > /service-2 -- > /code > /app.yaml > /service-3 -- > /code > /app.yaml > > Problem is I can't reference /common-code since all the app.yamls > reference the current folder... > > How do I achieve such a structure? > -- You received this message because you are subscribed to the Google Groups "Google App Engine" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/google-appengine. To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/b892ea69-a487-4303-9b5f-be06e037bab9%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
