Skip to content

Commit

Permalink
fix: gleam format
Browse files Browse the repository at this point in the history
  • Loading branch information
yuaanlin committed Aug 11, 2024
1 parent cfbdfc3 commit f462361
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/my_web_app.gleam
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import mist
import gleam/erlang/process
import gleam/bytes_builder
import gleam/http/response.{Response}
import gleam/erlang/os
import gleam/erlang/process
import gleam/http/response.{Response}
import gleam/int
import mist

pub fn get_port() -> Int {
case os.get_env("PORT") {
Ok(value) -> case int.parse(value) {
Error(e) -> 8080
Ok(i) -> i
}
Error(_) -> 8080 // If the environment variable is not set, fallback to 8080
Ok(value) ->
case int.parse(value) {
Error(e) -> 8080
Ok(i) -> i
}
Error(_) -> 8080
}
}

Expand Down

0 comments on commit f462361

Please sign in to comment.