File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
src/main/java/de/rwth/idsg/steve Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -66,11 +66,22 @@ public enum SteveConfiguration {
6666 gitDescribe = useFallbackIfNotSet (p .getOptionalString ("git.describe" ), null );
6767 profile = ApplicationProfile .fromName (p .getString ("profile" ));
6868
69+ // Enabled deployment on Heroku by checking for environment variable PORT
70+ String serverHost = null ;
71+ int port ;
72+ String portEnvVar = System .getenv ("PORT" );
73+ if (portEnvVar != null ) {
74+ port = Integer .parseInt (portEnvVar );
75+ } else {
76+ port = p .getInt ("http.port" );
77+ serverHost = p .getString ("server.host" );
78+ }
79+
6980 jetty = Jetty .builder ()
70- .serverHost (p . getString ( "server.host" ) )
81+ .serverHost (serverHost )
7182 .gzipEnabled (p .getBoolean ("server.gzip.enabled" ))
7283 .httpEnabled (p .getBoolean ("http.enabled" ))
73- .httpPort (p . getInt ( "http. port" ) )
84+ .httpPort (port )
7485 .httpsEnabled (p .getBoolean ("https.enabled" ))
7586 .httpsPort (p .getInt ("https.port" ))
7687 .keyStorePath (p .getOptionalString ("keystore.path" ))
You can’t perform that action at this time.
0 commit comments