I am The Smallest Yesod App!

Here is my source code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Main where
import Yesod
import Network.Wai.Handler.Warp (run)
import System.Environment
import Text.Blaze (preEscapedToMarkup)
import Text.Highlighting.Kate

mkYesod "()" [parseRoutes| / R GET |]
instance Yesod ()
getR = (\c -> defaultLayout $ setTitle "The Smallest Yesod App" >>
    [whamlet|
        <style>#{preEscapedToMarkup $ styleToCss pygments}
        <h3>I am The Smallest Yesod App!
        <p>Here is my source code:#{c}
        <a href="https://github.com/pbrisbin/thesmallestyesodapp.com">Make me smaller
    |]) =<< (liftIO $ fmap (formatHtmlBlock defaultFormatOpts {numberLines = True} . highlightAs "haskell") $ readFile "./site.hs")
main = getEnv "PORT" >>= \p -> toWaiApp () >>= run (read p)

Make me smaller