![]() ![]() I'm using a nest project and I've placed the code into a backend folder. As long as you have docker and docker-compose installed, it should all work! If you'd like to follow in the example, you can clone the GitHub repository. I've used nest as our framework since that's what is most applicable in our use cases. This article outlines how to set up debugging in a Typescript project that runs using docker containers. The tutorials were great but I couldn't find one that explained the process from start to finish, this article was what I worked off to get to this answer. So I started reading around and found that there are ways to bind to the debug ports for node projects. This means that the current solutions out there won't work for us, unless we want to run half of the stack through docker-compose and the other half directly on our PCs. Furthermore, we use docker-compose, to set up the full stack for local development. We use docker for our development environment to ensure that there is a fast setup. The problem is that that solution assumes we are running the application directly off our PCs. It's pretty straight forward, all you have to do is set up the execution script in Webstorm (or any IDE really) and you're good to go. Then change your WS run configuration to use this port and now anytime you serve the application, all you need to do is click on the debugger link to launch the debugger and it should work without needing to change the port number in your run configurations (Nx automatically assigns a random open port each time the app is initially launched).I've recently been looking at how people debug Typescript applications. You can also edit your serve configuration in your angular.json file (it maybe called something else if you aren't using angular) by adding `port: "port number goes here - 9229 is standard though". Now use a rest client to send a request to trigger a breakpoint and it should work as expected. Now add your breakpoints and click on one of the debuggin links above which will open the debugger window in WS. Next, create a run configuration in WS and select Attach to Nodejs/Chrome and create a new configuration by adding the port number. ![]() When you run nx serve "nest-app-goes-here" you will see that WebStorm automatically creates a debugging server.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |