WebFund 2015W: Tutorial 7

From Soma-notes
Jump to navigation Jump to search

In this tutorial you'll be learning about and extending ajax-notes. This application is persistent-notes from Tutorial 6 modified to work from a single page using client-side JavaScript to update the page in response to JSON objects returned from the server. The application expects there to be a MongoDB instance running on localhost with notes in the same format as that used by the code in Assignment 5 and Assignment 6 (and their corresponding tutorials).

Again note that ajax-notes includes a node_modules directory that may only work in the class VMs. If you are running it in another environment and the JavaScript fallbacks don't work properly you'll need to delete the node_modules directory and then type "npm install" to recreate it.

Tasks/Questions

  • If you prevent notes.js from loading client side, how does the app's functionality change? What about jQuery?
  • What do you get if you manually visit /getNotes when you are logged in? What about when you aren't logged in?
  • Why do the [edit] buttons look more like links?
  • What is the importance of the notesArea class?
  • What happens to ajax-notes when mongodb is not running when the app is started? What if it is shut down while the app is running?
    • You can stop and start mongodb by typing sudo service mongodb stop and sudo service mongodb start.
  • Implement a delete note button as described in Assignment 7, Question 1.

Getting Credit for Tutorial

You can either:

  • Attend most of a tutorial session and show you have made progress on the above tasks and questions (or you spent the time working on Assignment 6), or
  • Show a TA a working implementation of a delete note button.