Commit ed6b36ff authored by Christopher League's avatar Christopher League

Add /version route

parent 4dc0148f
......@@ -11,3 +11,4 @@
/book BookR GET POST
/final FinalR GET
/clear ClearR GET
/version VersionR GET
......@@ -21,6 +21,7 @@ module Handlers
, postBookR
, getFinalR
, getClearR
, getVersionR
) where
import qualified BookingForm as BF
......@@ -28,6 +29,7 @@ import Calendar
import Control.Monad.Trans.Maybe
import Data.FileEmbed (embedFile)
import qualified Data.SortedList as SL
import Development.GitRev
import Data.Time.Zones (localTimeToUTCTZ, utcToLocalTimeTZ)
import qualified FreshCache as FC
import Import
......@@ -138,3 +140,7 @@ getFaviconR = do
getRobotsR :: Handler TypedContent
getRobotsR =
return $ TypedContent typePlain $ toContent $(embedFile "config/robots.txt")
getVersionR :: Handler Text
getVersionR =
return $ $(gitHash) <> if $(gitDirty) then "+" else ""
......@@ -40,7 +40,6 @@ import Data.Time.Zones (TZ)
import Data.Time.Zones.All (TZLabel, fromTZName, toTZName)
import qualified Data.Time.Zones.All as TZ
import Data.Yaml (decodeEither')
import Development.GitRev
import Language.Haskell.TH.Syntax (Exp, Name, Q)
import Network.Wai.Handler.Warp (HostPreference)
import Yesod.Default.Config2 (applyEnvValue, configSettingsYml)
......@@ -222,13 +221,3 @@ varGoogleSecret = "BOOKME_GOOGLE_SECRET"
-- | Environment variable used for Google refresh token.
varGoogleRefreshToken :: IsString s => s
varGoogleRefreshToken = "BOOKME_GOOGLE_REFRESH"
showGit :: IO ()
showGit = do
say $ "gitBranch = " <> tshow $(gitBranch)
say $ "gitCommitCount = " <> tshow $(gitCommitCount)
say $ "gitCommitDate = " <> tshow $(gitCommitDate)
say $ "gitDescribe = " <> tshow $(gitDescribe)
say $ "gitDirty = " <> tshow $(gitDirty)
say $ "gitDirtyTracked = " <> tshow $(gitDirtyTracked)
say $ "gitHash = " <> tshow $(gitHash)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment