Debugging nodejs service in vscode

1. Install VScode

(Needless to say)

2. Write a running NodeJS program

In fact, I already have a running NodeJS program, don’t look at mine

Here is the program I have been running github.com/adouwt/node…

3. Create the. Vscode folder in the project and create the launch.json file

  
  {
    "configurations": [{"type": "node"."request": "launch"."name": "nodemon"."runtimeExecutable": "nodemon"."program": "${workspaceFolder}/nodeServer.js --exec babel-node"."restart": true."console": "integratedTerminal"."internalConsoleOptions": "neverOpen"}}]Copy the code

Among them: “the program” : “${workspaceFolder}/nodeServer.js –exec babel-node”, Nodeserver.js –exec babel-node can fully copy the contents of your own package.json startup script

4. Click on your bug

5. Poke your dots

So when we get to this point in the program we’re going to look at the parameters and I’m going to look at the parameters for users

The end!

The nodeJS code debugged above, github.com/adouwt/node… Nodejs + mongodb + Redis is a back-end API interface.

If reproduced, please indicate the source!

Thanks for browsing,