We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cfbdfc3 commit f462361Copy full SHA for f462361
src/my_web_app.gleam
@@ -1,17 +1,18 @@
1
-import mist
2
-import gleam/erlang/process
3
import gleam/bytes_builder
4
-import gleam/http/response.{Response}
5
import gleam/erlang/os
+import gleam/erlang/process
+import gleam/http/response.{Response}
6
import gleam/int
+import mist
7
8
pub fn get_port() -> Int {
9
case os.get_env("PORT") {
10
- Ok(value) -> case int.parse(value) {
11
- Error(e) -> 8080
12
- Ok(i) -> i
13
- }
14
- Error(_) -> 8080 // If the environment variable is not set, fallback to 8080
+ Ok(value) ->
+ case int.parse(value) {
+ Error(e) -> 8080
+ Ok(i) -> i
+ }
15
+ Error(_) -> 8080
16
}
17
18
0 commit comments