# Quick Guide for Tomcat

* [Download](https://tomcat.apache.org/download-80.cgi) and install the Tomcat server

* Tomcat management [page](http://localhost:8080/manager) 

  * ![](./tomcat-manager.PNG)

* Build the java spring boot project `gradle build`. Artifacts in `build\libs\something.war`

* Copy java `something.WAR` file to `C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\ROOT.war`

* run the server on CLI

  ```sh
  // "jpda" to allow remote attach to debug java code @ port 8000
  ///
  C:\Program Files\Apache Software Foundation\Tomcat 8.5\bin> .\catalina.bat jpda start
  ```

* Tomcat will extract WAR file to `C:\Program Files\Apache Software Foundation\Tomcat 8.5\ROOT`

* Build vueJS FE `npm run-script build`. Build artifacts will be created under `dist`

* Copy vueJS build artifacts contents `dist` to `C:\Program Files\Apache Software Foundation\Tomcat 8.5\ROOT\WEB-INF\classes\public`

* Reload tomcat to refresh the FE component
  
  * ![](./FE.PNG)
  
* Now you can access the web from browser
  
  * FE page : `http://localhost:8080`
  * BE api : `http://localhost:8080/v1/merchant/...`

# Remote Debugging (IntelliJ)

* Setup remote debugging configuration for
  * localhost:8000

* ![](./intelliJ-remotedebug.PNG)
* ![](./tomcat-start.PNG)