WebFund 2016W: Tutorial 7: Difference between revisions

From Soma-notes
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 6: Line 6:
# Change the upload success or failure page to be an HTML page that has a button to go back to /users entitle "Home".
# Change the upload success or failure page to be an HTML page that has a button to go back to /users entitle "Home".
# Add a download button for each file that when clicked sends the file back to the browser as a plain text, utf-8 encoded file.
# Add a download button for each file that when clicked sends the file back to the browser as a plain text, utf-8 encoded file.
# (Optional) Add a delete button for each file.
# (Optional) Make the file storage persistent by enabling MongoDB storage for sessions.
# (Optional) Make the file storage persistent by enabling MongoDB storage for sessions.
# (Optional) Make the accounts password protected.
# (Optional) Make the accounts password protected and the connection protected by TLS (SSL).
 
To get credit for the tutorial either work for the entire tutorial time or show that you have finished the four mandatory tasks.
 
For the optional tasks, here are some hints:
* Check out this old tutorial on [[WebFund 2014W: Tutorial 4|authenticated, persistent sessions]].  Note this code is using an old version of Express.  For having persistent sessions, see the [https://www.npmjs.com/package/connect-mongo connect-mongo] documentation.
* Note that sessions go away when someone logs in.  To fix, store user data separately from the session.
* Can you reuse the database connection for storing user data from the session database connection?

Latest revision as of 21:08, 9 March 2016

In this tutorial you will be working with upload-demo, a simple web app that can handle file uploads.

Tasks:

  1. Make the upload fail if the uploaded file is not of type "text/plain".
  2. Add a word count for each uploaded file to the file listing on /users.
  3. Change the upload success or failure page to be an HTML page that has a button to go back to /users entitle "Home".
  4. Add a download button for each file that when clicked sends the file back to the browser as a plain text, utf-8 encoded file.
  5. (Optional) Add a delete button for each file.
  6. (Optional) Make the file storage persistent by enabling MongoDB storage for sessions.
  7. (Optional) Make the accounts password protected and the connection protected by TLS (SSL).

To get credit for the tutorial either work for the entire tutorial time or show that you have finished the four mandatory tasks.

For the optional tasks, here are some hints:

  • Check out this old tutorial on authenticated, persistent sessions. Note this code is using an old version of Express. For having persistent sessions, see the connect-mongo documentation.
  • Note that sessions go away when someone logs in. To fix, store user data separately from the session.
  • Can you reuse the database connection for storing user data from the session database connection?