Skip to content

Commit

Permalink
Now it is smaller
Browse files Browse the repository at this point in the history
  • Loading branch information
The1Penguin committed Oct 23, 2024
1 parent 1c45697 commit 683ab60
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ webserver
-> MVar () -- ^ Update signal
-> IO ()
webserver Config{_cPort=webserverPort} viewRef upd =
run webserverPort $ foldr ($) (notFound (send $ html "not found..."))
[ middleware . get "/" (liftIO (readIORef viewRef) >>= send . html . encodeUtf8 . render)
, middleware . get "/r" (liftIO (tryPutMVar upd ()) >> send (redirect302 "/"))
run webserverPort $ foldr
(logStdout . static $(embedDir "static") <$>)
(notFound (send $ html "not found..."))
[ get "/" (liftIO (readIORef viewRef) >>= send . html . encodeUtf8 . render)
, get "/r" (liftIO (tryPutMVar upd ()) >> send (redirect302 "/"))
]
where
middleware = logStdout . static $(embedDir "static")

0 comments on commit 683ab60

Please sign in to comment.