Skip to content

Commit ac45e1e

Browse files
authored
Merge pull request #17 from ivan-demchenko/fix/http-server-example
fix(http-server): return command instead of task
2 parents 3adc9f2 + da3a16d commit ac45e1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

http-server/src/Main.gren

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ update msg model =
5656
case result of
5757
Ok server ->
5858
{ model = { model | server = Just server }
59-
, command = Stream.sendLine model.stdout
60-
"Server started"
59+
, command =
60+
Stream.sendLine model.stdout "Server started"
61+
|> Task.execute
6162
}
6263
Err (ServerError code message) ->
6364
{ model = model
64-
, command = Stream.sendLine model.stderr <|
65-
"Server failed to start: " ++ code ++ "\n" ++ message
65+
, command =
66+
Stream.sendLine model.stderr ("Server failed to start: " ++ code ++ "\n" ++ message)
67+
|> Task.execute
6668
}
6769

6870
GotRequest req res ->

0 commit comments

Comments
 (0)