# Webstorm-debug

_**Debug sakuraapi project right from webstorm**_

Debug from webstorm will save a lot time than traditional console logs.

Here is the list of steps to configure and debug your sakuraapi project.

1.Click on `Run` select `Edit configurations`.

![](https://289288345-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD_Z1UN9Oo-ajMvaLNA%2F-LDbVQL3huX8HhPETwqN%2F-LDbVRiX9aYt3t1gMLAK%2Fimage6.png?generation=1527523692748681\&alt=media)

2.Click on `+` to create a new configuration and select js.

![](https://289288345-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD_Z1UN9Oo-ajMvaLNA%2F-LDbVQL3huX8HhPETwqN%2F-LDbVRiZhhFL7UqPnRfD%2Fimage2.png?generation=1527523692668033\&alt=media)

3.`Name` Your configuration. Ex: "ts debug"

4.Select `Node Interpreter` configuration from drop down.

5.Select init `javascript file`. Ex: "dist/src/index.js" for sakuraapi project.

6.Click on `apply` and `ok`.

Voila! , Now your "ts debug"configuration is ready.

**How to debug a sakuraapi project from Webstorm.**

1\)Once "ts debug" is ready, start your project in debug mode by clicking on bug symbol.

![](https://289288345-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD_Z1UN9Oo-ajMvaLNA%2F-LDbVQL3huX8HhPETwqN%2F-LDbVRiagVMLYnZ8ak4N%2Fimage4.png?generation=1527523696653854\&alt=media)

2\)Your sakuraapi project running in debug mode.set a breakpoint by clicking on empty space beside code.

![](https://289288345-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD_Z1UN9Oo-ajMvaLNA%2F-LDbVQL3huX8HhPETwqN%2F-LDbVRicbjA1ocrG61Uc%2Fimage3.png?generation=1527523698098922\&alt=media)

3\)Hit that route in browser , you can see a hit to your breakpoint

![](https://289288345-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD_Z1UN9Oo-ajMvaLNA%2F-LDbVQL3huX8HhPETwqN%2F-LDbVRie_eEHv_QfpDY2%2Fimage5.png?generation=1527523697373459\&alt=media)

4\)You can see all the required information at that debug point.you can play with resume , step-in, step-out ,next-line and restart .

![](https://289288345-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LD_Z1UN9Oo-ajMvaLNA%2F-LDbVQL3huX8HhPETwqN%2F-LDbVRig0KtqKSRMDEZj%2Fimage1.png?generation=1527523697503735\&alt=media)

That's all folks
