Skip to content

Instantly share code, notes, and snippets.

@marco-mendes
Created May 28, 2017 19:44
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save marco-mendes/dead57a4067ca20db31425ed99896189 to your computer and use it in GitHub Desktop.
Save marco-mendes/dead57a4067ca20db31425ed99896189 to your computer and use it in GitHub Desktop.
public static void main(String[] args) throws UnknownHostException {
SpringApplication app = new SpringApplication(AngularspringbootmicrosservicoApp.class);
DefaultProfileUtil.addDefaultProfile(app);
Environment env = app.run(args).getEnvironment();
String protocol = "http";
if (env.getProperty("server.ssl.key-store") != null) {
protocol = "https";
}
log.info("\n----------------------------------------------------------\n\t" +
"Application '{}' is running! Access URLs:\n\t" +
"Local: \t\t{}://localhost:{}\n\t" +
"External: \t{}://{}:{}\n\t" +
"Profile(s): \t{}\n----------------------------------------------------------",
env.getProperty("spring.application.name"),
protocol,
env.getProperty("server.port"),
protocol,
InetAddress.getLocalHost().getHostAddress(),
env.getProperty("server.port"),
env.getActiveProfiles());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment