Class Notes (1,100,000)
CA (620,000)
Carleton (20,000)
COMP (500)
Lecture 20

COMP 2804 Lecture 20: Lecture 20

Computer Science
Course Code
COMP 2804
Anil Somayaji

This preview shows half of the first page. to view the full 3 pages of the document.
Lecture 20
Assignment 5 – last minute question
How does download functionality display the uploaded file?
Display as a page as a text file. Do res.send of a big string with each thing terminated by a new line. You
should be sending the file as a text on the page.
Assignment 6 hints
First and second part of the assignment is about adding a new functionality and is in the exam storage
code. The last two parts are already implemented in assignment 5 – analyzeLogs, but you just need to
change it to a single file.
Exam Storage
Little more complicated than interactive-demo.
public: contains everything that goes to the client directly (CSS and JavaScript files)
server: contains all the JavaScript file that will run on the server
start.js is a little JavaScript that you will use to start the server
views contains all the templates for generating html.
keys: cryptographic keys
Starting with start.js
var app = require(‘./server/app’);
App require is now in the server directory. We set the port, create the server and it start listening on
port 3000.
This is mostly the original app. We are specifying the ssl keys, doing logging in and has cookies.
app.use(express.static(‘public’)); is serving everything from public directory.
Starts with setting up the database.
UsersCollection contains documents which has a username and a password. The function
storeSaltedpassword stores the username and password in usersCollection.
Why do we have the same error message for both password and username? If someone is trying to
break into your system, you don’t want them to know that they have come across the valid account and
they are trying to figure out the password. You just want them to know that the username and the
password is not the right one. Therefore, there is a same error string for both username and password.
find more resources at
find more resources at
You're Reading a Preview

Unlock to view full version