Skip to content
Permalink
Browse files

Add sample users

  • Loading branch information...
bradparker committed Oct 2, 2019
1 parent 0e5e7ad commit fb94e6e661e95f4542b3f37df4c7a699dd0057d8
Showing with 19 additions and 1 deletion.
  1. +19 −1 src/Main.hs
@@ -8,7 +8,7 @@ module Main where

import Data.Aeson (ToJSON)
import Data.Proxy (Proxy(Proxy))
import Data.Time (Day)
import Data.Time (Day, fromGregorian)
import GHC.Generics (Generic)
import Network.Wai (Application)
import Network.Wai.Handler.Warp (run)
@@ -44,6 +44,24 @@ type UsersAPI =
"users"
:> (UsersIndex :<|> UsersShow)

users :: [User]
users =
[ User
{ name = "Isaac Newton"
, age = 372
, email = "isaac@newton.co.uk"
, username = "isaac"
, registrationDate = fromGregorian 1683 3 1
}
, User
{ name = "Albert Einstein"
, age = 136
, email = "ae@mc2.org"
, username = "albert"
, registrationDate = fromGregorian 1905 12 1
}
]

usersIndex :: Handler [User]
usersIndex = _

0 comments on commit fb94e6e

Please sign in to comment.
You can’t perform that action at this time.