Skip to content

Instantly share code, notes, and snippets.

Forked from itsuart/main.hs
Created July 18, 2022 17:40
What would you like to do?
Hello world Yesod example.
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings #-}
import Yesod
import Yesod.Core.Handler
data HelloWorld = HelloWorld
mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
instance Yesod HelloWorld
content = take (3 * 1024) $ repeat 'a'
getHomeR :: Handler RepHtml
getHomeR = hamletToRepHtml [hamlet|
$doctype 5
<html lang="en">
main :: IO ()
main = warp 3000 HelloWorld
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment