diff --git a/src/main/java/com/alura/aluraflixapi/infraestructure/railway/RailwayConfig.java b/src/main/java/com/alura/aluraflixapi/infraestructure/railway/RailwayConfig.java index 913d972..80cab96 100644 --- a/src/main/java/com/alura/aluraflixapi/infraestructure/railway/RailwayConfig.java +++ b/src/main/java/com/alura/aluraflixapi/infraestructure/railway/RailwayConfig.java @@ -1,13 +1,16 @@ package com.alura.aluraflixapi.infraestructure.railway; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class RailwayConfig { + @Value("server.port") + private String port; @Bean String getPort(){ - return System.getenv("PORT"); + return this.port = System.getenv("PORT"); } }