diff --git a/app/Main.hs b/app/Main.hs index 838ce22..44c1a1e 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -1,10 +1,27 @@ +{-# LANGUAGE OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes #-} +{-# LANGUAGE TemplateHaskell #-} +{-# LANGUAGE TypeFamilies #-} module Main where -import Control.Exception import Track(parseFile) import Data.List as List +import Yesod.Core + +data HelloWorld = HelloWorld + +mkYesod "HelloWorld" [parseRoutes| +/ HomeR GET +|] + +instance Yesod HelloWorld + +getHomeR :: Handler Html +getHomeR = defaultLayout [whamlet|Hello World!|] + main :: IO () main = do points <- Track.parseFile "track.gpx" - putStrLn ("loaded " ++ (show (List.length points))) + putStrLn ("loaded " ++ (show (List.length points)) ++ " points from GPX") + warp 3000 HelloWorld diff --git a/souplesse.cabal b/souplesse.cabal index f53857f..1a0d609 100644 --- a/souplesse.cabal +++ b/souplesse.cabal @@ -71,6 +71,7 @@ executable souplesse build-depends: base ^>=4.18.2.1 , souplesse-lib + , yesod-core == 1.6.25.1 -- Directories containing source files. hs-source-dirs: app