{-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Control.Monad.Trans (liftIO)
import qualified Data.Text.Lazy as L (Text, pack)
import Data.Time.Clock
main = scotty 3005 $ do
get "/" $ do
time <- liftIO getTime
html time
getTime :: IO L.Text
getTime = do
utcTime <- getCurrentTime
let timeText = L.pack $ show utcTime
return timeText
M.