How to download a Nodejs app?

35 views
Skip to first unread message

Mani Doraisamy

unread,
Dec 23, 2015, 5:33:14 PM12/23/15
to Google App Engine
I built a small app using Nodejs on app engine managed VM. It is still running; but I have lost its source code. Can I download that app similar to python or java?

I also tried SSH after making it user managed. But, I am not sure how to proceed. It is a single js file app. So, as long as I can see the source code I would be fine. Any suggestions?

Adam (Cloud Platform Support)

unread,
Dec 23, 2015, 10:05:50 PM12/23/15
to Google App Engine
When you said you tried SSH, did you actually gain access to the VM or did this fail? This is what you will need to do to access the application source. Note that once you SSH to the VM you will need to then connect to the Docker container in production. Please follow the steps at the end of 'Accessing the VM Environment' carefully.

The application is generally uploaded to the /app folder in the container's root but this can differ depending on what was specified in the Dockerfile. You could try searching for any JavaScript files from the command line inside the container:

(container)$ find / -name "*.js" 

If you locate the source probably the easiest thing to do is cat it to the terminal and copy and paste it from the scrollback. You could also leave the container and copy it it out to the host VM and from there grab it with gcloud compute copy-files from your local machine:

(hostvm)$ docker cp <containerId>:/file/path/within/container /hostvm/path/target
(localmachine)$ gcloud compute copy-files hostvm:/path/target /local/machine/dest
Reply all
Reply to author
Forward
0 new messages