Make simple yesod project
This commit is contained in:
parent
b17c5d9d3d
commit
bd9586148c
4 changed files with 26 additions and 6 deletions
|
|
@ -1,6 +1,10 @@
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Props
|
import Props
|
||||||
|
import Yesod
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = putStrLn helloWorld
|
main = warp 3000 App
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ extra-doc-files:
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- base >= 4.7 && < 5
|
- base >= 4.7 && < 5
|
||||||
|
- yesod
|
||||||
|
|
||||||
library:
|
library:
|
||||||
source-dirs: src
|
source-dirs: src
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,8 @@
|
||||||
cabal-version: 1.18
|
cabal-version: 1.18
|
||||||
|
|
||||||
-- This file has been generated from package.yaml by hpack version 0.33.0.
|
-- This file has been generated from package.yaml by hpack version 0.34.2.
|
||||||
--
|
--
|
||||||
-- see: https://github.com/sol/hpack
|
-- see: https://github.com/sol/hpack
|
||||||
--
|
|
||||||
-- hash: 057a536ac3d0fd40b3122084eee53201158527bbcd0dbac7cec33d8fd06cf208
|
|
||||||
|
|
||||||
name: props
|
name: props
|
||||||
version: 0.1.0.0
|
version: 0.1.0.0
|
||||||
|
|
@ -29,6 +27,7 @@ library
|
||||||
src
|
src
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
|
, yesod
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
||||||
executable props
|
executable props
|
||||||
|
|
@ -41,4 +40,5 @@ executable props
|
||||||
build-depends:
|
build-depends:
|
||||||
base >=4.7 && <5
|
base >=4.7 && <5
|
||||||
, props
|
, props
|
||||||
|
, yesod
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
|
|
|
||||||
19
src/Props.hs
19
src/Props.hs
|
|
@ -1,4 +1,19 @@
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE QuasiQuotes #-}
|
||||||
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
|
||||||
module Props where
|
module Props where
|
||||||
|
|
||||||
helloWorld :: String
|
import Yesod
|
||||||
helloWorld = "Hello World!"
|
|
||||||
|
data App = App
|
||||||
|
|
||||||
|
mkYesod "App" [parseRoutes|
|
||||||
|
/ HomeR GET
|
||||||
|
|]
|
||||||
|
|
||||||
|
instance Yesod App
|
||||||
|
|
||||||
|
getHomeR :: Handler Html
|
||||||
|
getHomeR = defaultLayout [whamlet|Hello World!|]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue