souplesse

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit fa289335d39a2ae3471690a57fca180ac8f65115
parent dcaa38e5fe86ff660053800d83181f7d0999eb9a
Author: Daniel Barlow <dan@telent.net>
Date:   Thu, 31 Oct 2024 23:58:47 +0000

add yesod

hello world exaple is based on
https://github.com/yesodweb/yesod?tab=readme-ov-file#getting-started

Diffstat:
Mapp/Main.hs | 21+++++++++++++++++++--
Msouplesse.cabal | 1+
2 files changed, 20 insertions(+), 2 deletions(-)

diff --git 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 @@ -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