In our application we have used SpringApplicationBuilder
in the starter
application. starter
is an simple application which will start the actual application instances programatically.
The number of processes to be started and type of process web/standalone will be passed as an argument to starter
application, based on the arguments the application instances will be started. we have used -w
to start as web application for state management.
boolean isWeb = // options parser, parse -w
new SpringApplicationBuilder(SpringBootAngularApp.class).web(isWeb).run(args);
There is another way of doing the same
SpringApplication sp = new SpringApplication(SpringApplicationBuilder.class);
sp.setWebEnvironment(false);
sp.run(args);
We can also customise banner, loggers with SpringApplicationBuilder
.
read the doc for more usage