The light-router instance serves the Single Page Application and acts as a proxy and load balancer to access the APIs behind it. From the previous login-view, we have seen the complicated interactions between the Single Page Application, Login View of OAuth 2.0 provider, and the StatelessAuthHandler wired in the light-router chain. This puts the light-router as a central point in the entire application. To solve issues with the UI, and microservices, it is easier to debug into the router instance.
There are two ways to debug light-docker.
As the light-4j application is just a POJO without any container, you can debug locally just like a simple Java application with the entry point as com.networknt.server.Server. If you are using the externalized configuration folder, then you can add an option as -Dlight-4j-config-dir=xxx
Notice that we are using the absolute path for the base to load the two single-page applications.
Remote Docker Container
Sometimes, the application might work well in standalone mode but doesn’t work inside a docker container. In most cases, this is due to the docker network issue. A lot of developers are getting used to the localhost and don’t know that the same localhost points to the docker OS loopback address instead of the docker host address.
To resolve issues in the docker container, you can connect to the application within the docker container to debug remotely.