Let Heroku decide which http port to use

pull/61/head
luccioman 9 years ago
parent 66fea8add1
commit b57a06d88e

@ -1 +1 @@
web: java $JAVA_OPTS -classpath target/classes:lib/* net.yacy.yacy
web: java $JAVA_OPTS -Dhttp.port=$PORT -classpath target/classes:lib/* net.yacy.yacy

@ -229,6 +229,15 @@ public class serverSwitch {
*/
public int getLocalPort() {
/* A system property "http.port" may override configuration
* This is useful when running YaCy inside a container manager such as Heroku which decide which http port to use */
String systemDefinedPort = System.getProperty("http.port");
if(systemDefinedPort != null) {
try {
return Integer.parseInt(systemDefinedPort);
} catch(NumberFormatException e) {
}
}
return getConfigInt("port", 8090);
}

Loading…
Cancel
Save