Add hello world example to readme & format code

This commit is contained in:
sigma-andex
2022-05-22 17:54:11 +01:00
parent 345675d5bd
commit fcf532bd71
10 changed files with 91 additions and 54 deletions

View File

@@ -18,6 +18,7 @@ route :: RD.RouteDuplex' Route
route = RD.root $ RG.sum
{ "SayHello": RG.noArgs
}
-- | The path to the file containing the response to send
filePath :: String
filePath = "./docs/Examples/BinaryResponse/circle.png"
@@ -32,7 +33,7 @@ router = const $ readFile filePath >>= ok' responseHeaders
-- | Boot up the server
main :: ServerM
main =
serve { port: 8080, onStarted } { route, router }
serve { port: 8080, onStarted } { route, router }
where
onStarted = do
log " ┌──────────────────────────────────────┐"