X Tutup
Skip to content

Commit 9f9bcde

Browse files
committed
add port
1 parent 3478e9b commit 9f9bcde

File tree

1 file changed

+5
-1
lines changed
  • microframeworks/pippo/pippo-hello/src/main/java/pippo/demo

1 file changed

+5
-1
lines changed
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package pippo.demo;
22

3+
import java.util.Optional;
4+
35
import ro.pippo.core.Pippo;
46

57
public class AppMain {
68
public static void main(String[] args) {
9+
10+
Optional<String> port = Optional.ofNullable(System.getenv("PORT"));
711
var pippo = new Pippo(new MyApplication());
812
pippo
913
.setFilterPath("/api/*")
10-
.start();
14+
.start(Integer.parseInt(port.orElse("8080")));
1115
}
1216
}

0 commit comments

Comments
 (0)
X Tutup