Reputation: 4070
Is it possible to debug a Spring application running on jetty and the front-end angular part at the same time in IntelliJ Idea?
The breakpoints in the backend work great, but the front-end ones are ignored.
Upvotes: 0
Views: 790
Reputation: 1494
Yes, it's posible. You need to install this Chrome Extension: https://chrome.google.com/webstore/detail/jetbrains-ide-support/hmhgeddbohgjknpmjagkdomcpobmllji?utm_source=chrome-ntp-icon
To debug the angular project, you create a new debug configuration:
In IntelliJ Idea go to Run -> Edit configurations. Click the + button (Add New Configuration) and select the JavaScript Debug. Change the URL with your application local development url, usually http://localhost:4200/
Save the configuration, execute ng serve
and run the configuration in debug mode.
You get the breakpoints working in server and client!!!
Upvotes: 1
Reputation: 4070
It can be done in this way with IntelliJ Idea:
For backend (pretty obvious)
Create a Maven run profile and pass in these arguments: jetty:run.
Then debug this run configuration. This will enable you to 'listen' to the backend of your application.
For frontend:
Create a JavaScript Debug run profile and set it up as follows: URL: http://localhost:9070/ (this is where my jetty server and my application was running).
Then you have to set the REMOTE URL of the directory where you AngularJS app is (in my case it was /app) to: http://localhost:9070/
And all that's left is to run as debug this configuration and that will make debugging the front end possible also.
Upvotes: 0