Skip to content

Commit

Permalink
Merge pull request #17 from ivan-demchenko/fix/http-server-example
Browse files Browse the repository at this point in the history
fix(http-server): return command instead of task
  • Loading branch information
robinheghan authored Oct 24, 2024
2 parents 3adc9f2 + da3a16d commit ac45e1e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions http-server/src/Main.gren
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,15 @@ update msg model =
case result of
Ok server ->
{ model = { model | server = Just server }
, command = Stream.sendLine model.stdout
"Server started"
, command =
Stream.sendLine model.stdout "Server started"
|> Task.execute
}
Err (ServerError code message) ->
{ model = model
, command = Stream.sendLine model.stderr <|
"Server failed to start: " ++ code ++ "\n" ++ message
, command =
Stream.sendLine model.stderr ("Server failed to start: " ++ code ++ "\n" ++ message)
|> Task.execute
}

GotRequest req res ->
Expand Down

0 comments on commit ac45e1e

Please sign in to comment.