Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

IntentionCommand
Comment out block of codectrl+K+C
Remove comment around a blockctrl+K+U


Working with Node.js Web Application

Use this sample project

Begin by using the Run button on the left of VSC.

Image Added

Select the run button at the top/ Add Configuration...

From the dropdown search for "Node.js: Attach to Process"

Image Added

Code Block
languagejs
titlelaunch.json
    {
        "name": "Attach by Process ID",
        "processId": "${command:PickProcess}",
        "request": "attach",
        "skipFiles": [
            "<node_internals>/**"
        ],
        "type": "pwa-node"
    }

Now attach VSC to it using the new launch configuration you created above - as you can see here our app is the first in the list

Image Added


Refresh the browser, the breakpoints should be reached

Using SSH from VSC

Info
titleAssumption

These instructions assume that you have created a VM with a public key already assigned to it, and you have the public/private keys available to you on your host.  AWS creates and assigns the keys for you, GCP does not, you will need to USE ssh-keygen to create the keys and then assign the public when you create the VM.  I'm not sure about Azure


  1. Install SSH - Remote tools
  2. Image Added
  3. Create a config file that contains the connection details, the file is called config with no file extension and should be placed in the /Users/<username>/.ssh folder

  4. Code Block
    Host sels-mc
    	HostName 130.211.75.156
    	IdentityFile ~/.ssh/gcp-key
    	User selvy

    The indentation is important

  5. Open the Remote connection
  6. Image Added
  7. Image Added
  8. Image Added
  9. You might be prompted for OS version, select what's appropriate
  10. A new VSC window appears, select the file explorer button
  11. Image Added
  12. Select Open Folder
  13. Image Added
  14. Your home folder on the remote VM should be listed, select OK
  15. The view should update to show the files in your home folder
  16. Image Added
  17. Opening a terminal window in VSC will shell into the terminal on the remote VM that your VSC instance is connected
  18. Image Added