{-# LANGUAGE OverloadedStrings #-} module Main where import Database.SQLite.Simple import Web.Spock.Safe hiding (head) import Within.DBMemorial.Post main :: IO () main = do conn <- open "../db/posts.db" -- Simple tests to prove we're reading from SQLite r <- query_ conn "SELECT * FROM Posts WHERE page=1" :: IO [Post] let h = head r -- Set up the URL router runSpock 5000 $ spockT id $ do get root $ text $ postBody h