SHARE
TWEET

Untitled

a guest Aug 12th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. data User = User { username :: String } deriving (Show, Read)
  2.  
  3. getUsers :: Pipe -> IO [Document]
  4. getUsers pipe = access pipe master "mydb" (find (select [] "users") >>= rest)
  5.  
  6. server :: Pipe -> ScottyM()
  7. server pipe =
  8.     get "/" $ do
  9.         res <- liftIO $ getUsers pipe
  10.         -- json $ T.pack $ show res
RAW Paste Data
Top