Skip to content

Commit

Permalink
change SERVER_PORT to PORT
Browse files Browse the repository at this point in the history
  • Loading branch information
ecostanzi committed May 21, 2024
1 parent 7314513 commit b81f58a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
12-factor-demo:
image: intesys/twelve-factor-app-kotlin:latest
environment:
- SERVER_PORT=8080
- PORT=8080
- CUSTOM_MESSAGE=Hello World From Docker
ports:
- 8085:8080
2 changes: 1 addition & 1 deletion src/main/kotlin/Configs.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class Configs {
loadPropertyFile("classpath:application.properties"), // default dev properties
loadPropertyFile("classpath:application-local.properties"), // default personal properties (not versioned)
loadPropertyFile("application.properties"), // file system properties (in production)
buildPropertiesFromEnv("SERVER_PORT", "CUSTOM_MESSAGE") // environment variables always win
buildPropertiesFromEnv("PORT", "CUSTOM_MESSAGE") // environment variables always win
)

fun loadPropertyFile(filePath: String): Properties {
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fun main() {
val app = Javalin.create { config ->
config.staticFiles.add("/public")
}
.start(config.getIntegerProperty("SERVER_PORT"))
.start(config.getIntegerProperty("PORT"))

app.get("/configs") { ctx ->
ctx.json(mapOf("ai" to config.getProperty("CHAT_CLIENT")))
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SERVER_PORT=8080
PORT=8080
CUSTOM_MESSAGE="Hello World From Configs"

CHAT_CLIENT=DUMMY_CHAT
Expand Down

0 comments on commit b81f58a

Please sign in to comment.