Skip to content

Commit 70455a3

Browse files
josephburnettknative-prow-robot
authored andcommitted
Use PORT environment variable. (#468)
1 parent b096963 commit 70455a3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

serving/samples/helloworld-clojure/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ following instructions recreate the source files from this folder.
3636
"!\n")})
3737

3838
(defn -main [& args]
39-
(run-jetty handler {:port 8080}))
39+
(run-jetty handler {:port (if-let [port (System/getenv "PORT")]
40+
(Integer/parseInt port)
41+
8080)}))
4042
```
4143

4244
1. In your project directory, create a file named `project.clj` and copy the code

serving/samples/helloworld-clojure/src/helloworld/core.clj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@
1212
"!\n")})
1313

1414
(defn -main [& args]
15-
(run-jetty handler {:port 8080}))
15+
(run-jetty handler {:port (if-let [port (System/getenv "PORT")]
16+
(Integer/parseInt port)
17+
8080)}))

0 commit comments

Comments
 (0)