WebFund 2016W: Tutorial 4: Difference between revisions

From Soma-notes
Created page with "'''This tutorial is still a work in progress.''' In this tutorial you will be working with [http://homeostasis.scs.carleton.ca/~soma/webfund-2016w/code/examforms.zip examform..."
 
Line 16: Line 16:
# Change /list to show the list sorted by name.
# Change /list to show the list sorted by name.
# Create a /delete page that asks for a name to delete.  It then POSTs to /deleted which confirms that the name was deleted.  This page has a button to go back Home.
# Create a /delete page that asks for a name to delete.  It then POSTs to /deleted which confirms that the name was deleted.  This page has a button to go back Home.
# Make the server save the entered names to a file when the server is terminated by a Ctrl-C and load those names when the server is restarted.


==Code==
==Code==

Revision as of 18:55, 2 February 2016

This tutorial is still a work in progress.

In this tutorial you will be working with examforms, a streamlined version of form-demo that will be the focus of the midterm.

After unpacking, you start examforms.js by running "node examforms.js".

Tasks

Make the following changes to examforms:

  1. Make it so that typing "PORT=7000 node examforms.js" causes it to listen on port 7000.
  2. Fix stylesheet loading. (Currently the browser will request the stylesheet but the server responds with 404.)
  3. Add a Phone number field to the program.
  4. Make the text bigger.
  5. Add an image to /. The image should be loaded from the server.
  6. Change /list to show the list sorted by name.
  7. Create a /delete page that asks for a name to delete. It then POSTs to /deleted which confirms that the name was deleted. This page has a button to go back Home.
  8. Make the server save the entered names to a file when the server is terminated by a Ctrl-C and load those names when the server is restarted.

Code