main = do
  putStrLn "Starting Server..."

  scotty 3000 $ do
    get "/hello/:name" $ do
      name <- param "name"
      text ("hello " <> name <> "!")

    get "/users" $ do
      json allUsers

    get "/users/:id" $ do
      id <- param "id"
      json (filter (matchesId id) allUsers)

    -- assignment: post user and print it out
    post "/users" $ do
      user <- jsonData :: ActionM User
      json user
main = do
  putStrLn "Starting Server..."

  scotty 3000 $ do
    get "/hello/:name" $ do
      name <- param "name"
      text ("hello " <> name <> "!")

    get "/users" $ do
      json allUsers

    get "/users/:id" $ do
      id <- param "id"
      json (filter (matchesId id) allUsers)

    -- assignment: post user and print it out
    post "/users" $ do
      user <- jsonData :: ActionM User
      json user
main = do
  putStrLn "Starting Server..."

  scotty 3000 $ do
    get "/hello/:name" $ do
      name <- param "name"
      text ("hello " <> name <> "!")

    get "/users" $ do
      json allUsers

    get "/users/:id" $ do
      id <- param "id"
      json (filter (matchesId id) allUsers)

    -- assignment: post user and print it out
    post "/users" $ do
      user <- jsonData :: ActionM User
      json user