yesod-gitrev

A subsite for displaying git information.

Version on this page:[email protected]:1
LTS Haskell 15.14:0.2.1
Stackage Nightly 2020-05-26:0.2.1
Latest on Hackage:0.2.1

See all snapshots yesod-gitrev appears in

BSD-3-Clause licensed by Dan Burton
Maintained by [email protected]

Module documentation for 0.1.0.0

This version can be pinned in stack with:[email protected]:0088808c1e3352875d89e9bc7123d9e27fe34b6120e0d7fda31f94ace6c41bd3,696

A subsite for displaying git information.

You can use the gitRev splice (or tGitRev typed splice) to generate a value of type GitRev. Put this in your app’s foundation, add a route to the subsite, and you’re good to go.

See [Haskell and Yesod > Creating a Subsite] (http://www.yesodweb.com/book/creating-a-subsite) for details on how Yesod subsites work.

-- examples/Main.hs

{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes       #-}
{-# LANGUAGE TemplateHaskell   #-}
{-# LANGUAGE TypeFamilies      #-}

import Yesod
import Yesod.GitRev

data Master = Master
  { getGitRev :: GitRev
  }

mkYesod "Master" [parseRoutes|
/build-version GitRevR GitRev getGitRev
|]

instance Yesod Master

main = warp 3000 $ Master $$(tGitRev)