Do the following exercises for this homework.

  1. Extend your solution for homework 1 in the following ways.

    1. Add two (separate) client-side webpages:

      addPerson.html
      This page collects the relevant data for a new person from the user using a form and sends that data to the server to be added to the in-memory database.
      getPerson.html
      This page gets a person ID from the user and displays the data for that user using a new DOM entity placed below the input form.

      The former upgrade will require jQuery/AJAX for forms, see AJAX & Deferreds (under the “Sending data & working with forms” section) for an example of how to do this.

    2. Extend the server to support GET, PUT, POST and DELETE operations on the existing in-memory database using the routes given in homework appropriately.

      /people
      This should allow you to get a list of people (as implemented before) or add a new person based on form data.
      /person/id
      This should allow you to get, update (i.e., PUT) or delete person records identified by the given ID.
      /person/id/name
      /person/id/years
      These two routes should get the given data as implemented before.

      Use appropriate HTTP methods, return codes and (simple but usable) jQuery-UI widgets.

    Note that the new client pages specified above will only implement the creation of new person records, so the other database operations would need to be testing using curl. You do not need to provide the curl commands you used for testing.

Checking in

We will grade your work according to the following criteria: