Use Text instead of String
This commit is contained in:
parent
b5f1a707e2
commit
5a14a1849a
|
@ -10,10 +10,10 @@ import Web.Spock.Safe hiding (head)
|
||||||
|
|
||||||
data Post = Post {
|
data Post = Post {
|
||||||
postID :: Int
|
postID :: Int
|
||||||
, postOID :: String
|
, postOID :: Text
|
||||||
, postBody :: String
|
, postBody :: Text
|
||||||
, postMarkdown :: String
|
, postMarkdown :: Text
|
||||||
, postAuthor :: String
|
, postAuthor :: Text
|
||||||
, postPage :: Int
|
, postPage :: Int
|
||||||
} deriving (Show, Eq)
|
} deriving (Show, Eq)
|
||||||
|
|
||||||
|
@ -31,6 +31,4 @@ main = do
|
||||||
-- Set up the URL router
|
-- Set up the URL router
|
||||||
runSpock 5000 $ spockT id $ do
|
runSpock 5000 $ spockT id $ do
|
||||||
get root $
|
get root $
|
||||||
text $ pack $ postBody h
|
text $ postBody h
|
||||||
get ("hello" <//> var) $ \name ->
|
|
||||||
text ("Hello " <> name <> "!")
|
|
||||||
|
|
Loading…
Reference in New Issue