{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE NoImplicitPrelude #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeFamilies #-} module YesodTodo where import Conduit import Control.Concurrent.STM.Lifted as STM import Control.Monad.Reader import Prelude hiding (interact) import System.Random (randomRIO) import Text.Blaze.Front.Renderer (renderNewMarkup) import Yesod.Core import Yesod.Static import Yesod.WebSockets import qualified Data.Text as T import Bridge import Todo import Web.Front.Broadcast -- * App data App = App { appModel :: TVar Model , appChannel :: TChan (Out (Action Msg)) , appStatic :: Static } mkYesod "App" [parseRoutes| / HomeR GET /static StaticR Static appStatic |] -- * API instance Yesod App where defaultLayout widget = do pc <- widgetToPageContent [whamlet|^{widget}|] withUrlRenderer [hamlet|
^{pageHead pc}