Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christopher League
bookme
Commits
ed6b36ff
Commit
ed6b36ff
authored
Jun 04, 2018
by
Christopher League
Browse files
Add /version route
parent
4dc0148f
Changes
3
Hide whitespace changes
Inline
Side-by-side
config/routes
View file @
ed6b36ff
...
...
@@ -11,3 +11,4 @@
/book BookR GET POST
/final FinalR GET
/clear ClearR GET
/version VersionR GET
src/Handlers.hs
View file @
ed6b36ff
...
...
@@ -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
""
src/Settings.hs
View file @
ed6b36ff
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment