Richu Andrews
Richu Andrews

Reputation: 33

what is the difference between below two statements in application.properties file in spring boot

what is the difference between below two statements in application.properties file in spring boot.

server.port =8080 and server.port = ${PORT:8080}

please help with the explanation

Upvotes: 3

Views: 95

Answers (1)

Jishnu Prathap
Jishnu Prathap

Reputation: 2033

  1. server.port = ${PORT:8080} will check for an environment variable PORT and take its value , if not present defaults to 8080.
  2. server.port =8080 will always be 8080

Upvotes: 5

Related Questions