Details
-
New Feature
-
Resolution: Fixed
-
Minor
-
None
-
None
-
None
-
All
-
0.16.0
-
GreenHopper Ranking:0|i0xd9v:
-
9223372036854775807
-
Small
Description
For DevOps purposes I need to have the capability to modify at runtime the base HTTP root context on which the TCOMP REST API service will listen for requests.
This will allow more complex integrations with AWS Application Load Balancers.
Currently, this root context is '/' however we would like to use more specific URL patterns, like '/api/tcomp' for example.
To configure this we would like to use an environment variable provided to the TCOMP REST API docker container at runtime.
So this env var would be injected in a Springboot configuration file to be used as the HTTP root context.
Technical implementation
Thanks to spring-boot configuration, it's easy to change the web application root context with the server.contextPath property.
To change the tcomp root context, you need to add --server.contextPath=/tcomp argument when you start the server.
java -jar components-api-service-rest-all-components-0.1.0-SNAPSHOT.jar --server.contextPath=/toto
Moreover, the default root context is now /tcomp