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