Skip to content

Commit

Permalink
scotty-examples: fix a type error
Browse files Browse the repository at this point in the history
  • Loading branch information
fumieval committed Oct 15, 2023
1 parent 4eb6645 commit 07b0035
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions examples/scotty-examples.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ executable scotty-upload
bytestring,
filepath,
scotty,
text,
transformers,
wai-extra,
wai-middleware-static
Expand Down
3 changes: 2 additions & 1 deletion examples/upload.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module Main (main) where
import Web.Scotty

import Control.Monad.IO.Class
import qualified Data.Text.Lazy as TL

import Network.Wai.Middleware.RequestLogger
import Network.Wai.Middleware.Static
Expand Down Expand Up @@ -39,7 +40,7 @@ main = scotty 3000 $ do
-- write the files to disk, so they will be served by the static middleware
liftIO $ sequence_ [ B.writeFile ("uploads" </> fn) fc | (_,fn,fc) <- fs' ]
-- generate list of links to the files just uploaded
html $ mconcat [ mconcat [ fName
html $ mconcat [ mconcat [ TL.fromStrict fName
, ": "
, renderHtml $ H.a (H.toHtml fn) H.! (href $ H.toValue fn) >> H.br
]
Expand Down

0 comments on commit 07b0035

Please sign in to comment.