Created
April 26, 2019 11:57
-
-
Save brianmarete/0f2a3c3bfbccf2b8c0cf4097ea2a1bc5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class App { | |
public static void main(String[] args) { | |
ProcessBuilder process = new ProcessBuilder(); | |
Integer port; | |
// This tells our app that if Heroku sets a port for us, we need to use that port. | |
// Otherwise, if they do not, continue using port 4567. | |
if (process.environment().get("PORT") != null) { | |
port = Integer.parseInt(process.environment().get("PORT")); | |
} else { | |
port = 4567; | |
} | |
port(port); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment