mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-19 00:01:41 +02:00
Let Heroku decide which http port to use
This commit is contained in:
parent
66fea8add1
commit
b57a06d88e
2
Procfile
2
Procfile
|
@ -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…
Reference in New Issue
Block a user