File tree Expand file tree Collapse file tree 5 files changed +24
-5
lines changed
appengine-simple-jetty-main/src/main/java/com/example/appengine/demo/jettymain
springboot-helloworld/src/main/resources
vertx-helloworld/src/main/java/com/example/appengine/vertxhello Expand file tree Collapse file tree 5 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ public static void main(String[] args) throws Exception {
3434
3535 // Create a basic Jetty server object that will listen on port defined by
3636 // the PORT environment variable when present, otherwise on 8080.
37- // Note: If you set this to port 0, a randomly available port will be
38- // assigned. You can find the assigned port in the logs or programmatically
39- // obtain it.
4037 int port = Integer .parseInt (System .getenv ().getOrDefault ("PORT" , "8080" ));
4138 Server server = new Server (port );
4239
Original file line number Diff line number Diff line change 8282 <!-- Copy dependencies of exploded fatjar to appengine-staging directory -->
8383 <configuration >
8484 <libDir >${project.build.directory} /appengine-staging/lib</libDir >
85- <finalName >${project.build.directory} /appengine-staging/${build.finalName} </finalName >
85+ <finalName >${project.build.directory} /appengine-staging/${project. build.finalName} </finalName >
8686 </configuration >
8787 </plugin >
8888 <!-- Set Surefire version to work with Junit5 -->
Original file line number Diff line number Diff line change 1+ # Copyright 2019 Google LLC
2+ #
3+ # Licensed under the Apache License, Version 2.0 (the "License");
4+ # you may not use this file except in compliance with the License.
5+ # You may obtain a copy of the License at
6+ #
7+ # http://www.apache.org/licenses/LICENSE-2.0
8+ #
9+ # Unless required by applicable law or agreed to in writing, software
10+ # distributed under the License is distributed on an "AS IS" BASIS,
11+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+ # See the License for the specific language governing permissions and
13+ # limitations under the License.
14+
15+ # Set the port to the PORT environment variable
16+ quarkus.http.port =${PORT:8080}
Original file line number Diff line number Diff line change 1111# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212# See the License for the specific language governing permissions and
1313# limitations under the License.
14+
15+ # Set the port to the PORT environment variable
16+ server.port =${PORT:8080}
Original file line number Diff line number Diff line change @@ -37,10 +37,13 @@ public void start(Future<Void> startFuture) {
3737 Router router = Router .router (vertx );
3838 router .route ().handler (this ::handleDefault );
3939
40+ // Get the PORT environment variable for the server object to listen on
41+ int port = Integer .parseInt (System .getenv ().getOrDefault ("PORT" , "8080" ));
42+
4043 vertx
4144 .createHttpServer ()
4245 .requestHandler (router )
43- .listen (8080 , ar -> startFuture .handle (ar .mapEmpty ()));
46+ .listen (port , ar -> startFuture .handle (ar .mapEmpty ()));
4447 }
4548
4649 private void handleDefault (RoutingContext routingContext ) {
You can’t perform that action at this time.
0 commit comments