Skip to content

Commit

Permalink
Added port configuration to deploy on railway
Browse files Browse the repository at this point in the history
  • Loading branch information
LauroSilveira committed Dec 19, 2023
1 parent 06c7e28 commit 1f5cc92
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.alura.aluraflixapi.infraestructure.railway;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RailwayConfig {

@Bean
String getPort(){
return System.getenv("PORT");
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server:
port: 8080
port: ${PORT:8080}
# Disable StackTrace of Spring on response when an error happen
error:
include-stacktrace: never
Expand Down

0 comments on commit 1f5cc92

Please sign in to comment.