We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04d5f07 commit e38f8eeCopy full SHA for e38f8ee
src/main/java/org/codecop/redgreen/Main.java
@@ -23,7 +23,11 @@ public static void main(String[] args) {
23
}
24
25
private static int determinePort() {
26
- // String port = System.getenv().getOrDefault("PORT", "4567");
+ // get Heroku assigned üort
27
+ ProcessBuilder processBuilder = new ProcessBuilder();
28
+ if (processBuilder.environment().get("PORT") != null) {
29
+ return Integer.parseInt(processBuilder.environment().get("PORT"));
30
+ }
31
String port = System.getProperty("PORT", "4567"); // -DPORT=4567
32
return Integer.parseInt(port);
33
0 commit comments