Skip to content

Commit

Permalink
Attempt at fixing build
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <[email protected]>
  • Loading branch information
valaparthvi committed Mar 28, 2023
1 parent 8502274 commit bb7b7c1
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ However, this task is made absurdly simple with the help of OpenShift Toolkit.
`odo` enables this plugin to do what it does.

## Prerequisites
1. [You have logged in to your cluster](../../quickstart/nodejs.md#step-1-connect-to-your-cluster-and-create-a-new-namespace-or-project).
2. [You have initialized a Node.js application with odo](../../quickstart/nodejs.md#step-2-initializing-your-application--odo-init-).
1. [You have logged in to your cluster](../quickstart/nodejs.md#step-1-connect-to-your-cluster-and-create-a-new-namespace-or-project).
2. [You have initialized a Node.js application with odo](../quickstart/nodejs.md#step-2-initializing-your-application--odo-init-).
3. Open the application in the IDE.
4. Install OpenShift Toolkit Plugin in your preferred VS Code or a Jet Brains IDE.

Expand All @@ -24,39 +24,39 @@ In the plugin window, you should be able to see the cluster you are logged into

Right click on "my-nodejs-app" and select "Start on Dev".

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Start%20Dev%20Session.png "Starting Dev session")
![](/img/docs/user-guides/advanced/Start%20Dev%20Session.png "Starting Dev session")

Wait until the application is running on the cluster.

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Wait%20until%20Dev%20Session%20finishes.png "Wait until Dev session finishes")
![](/img/docs/user-guides/advanced/Wait%20until%20Dev%20Session%20finishes.png "Wait until Dev session finishes")

Our application is now available at 127.0.0.1:20001. The debug server is running at 127.0.0.1:20002.

## Step 2. Start the Debugging session

Right click on "my-nodejs-app" and select "Debug".

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Select%20Debug%20Session.png "Select Debug")
![](/img/docs/user-guides/advanced/Select%20Debug%20Session.png "Select Debug")

Debug session should have started successfully at the debug port, in this case, 3000. And you must be looking at the "DEBUG CONSOLE".

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Debug%20Session%20Starts.png "Debug session starts")
![](/img/docs/user-guides/advanced/Debug%20Session%20Starts.png "Debug session starts")

## Step 3. Set Breakpoints in the application

Now that the debug session is running, we can set breakpoints in the code.

Open 'server.js' file if you haven't opened it already. We will set a breakpoint on Line 55 by clicking the red dot that appears right next to line numbers.

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Add%20Breakpoint.png "Add breakpoint")
![](/img/docs/user-guides/advanced/Add%20Breakpoint.png "Add breakpoint")

From a new terminal, or a browser window, ping the url at which the application is available, in this case, it is 127.0.0.1:20001.

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Ping%20Application.png "Ping Application")
![](/img/docs/user-guides/advanced/Ping%20Application.png "Ping Application")

The debug session should halt execution at the breakpoint, at which point you can start debugging the application.

![](/docs/website/static/img/docs/user-guides/advanced/debugging/Application%20Debugged.png "Application Debugged")
![](/img/docs/user-guides/advanced/Application%20Debugged.png "Application Debugged")


To learn more about running and debugging an application on cluster with OpenShift Toolkit, see the links below.
Expand Down

0 comments on commit bb7b7c1

Please sign in to comment.