You have a tilde in there that is not correct. You want https://cs.wellesley.edu/cs304node/people/
The other folder exists, but it's not being served by Apache, since it's not in public_html.
Hmm. I'm not sure I quite agree, but I can see your point. Redirecting when a page has moved isn't just aesthetic. Later, we'll learn how redirecting after a POST can avoid certain troubles with re-submission. But in terms of a preferred or authoritative link, you do have a reasonable point.
Well, the API for MongoDB is asynchronous, so we have to use asynchronous handler functions when we access the database.
Furthermore, having asynchronous handlers allows for greater concurrency: other requests can come in and be served (or, at least, initiated), while we are waiting for MongoDB to respond.
That increase in concurrency is actually the reason industry is so excited by Node.js and MongoDB.
It's created by Express to hold the info from the query string: ?month=6
It's a dictionary of key/value pairs corresponding to the key/value pairs from the the FORM that uses method=GET.
For sure!
If the EJS file is sufficiently generic, there's no reason not to reuse it. It's not common; in most cases, each kind of page will have its own template, but reuse is good when possible.
Coding should always be clear and easy to read. Using EJS means
that HTML and other markup information is separate from the more
functional code of handler functions, making
our server.js
file clearer and easier to read.
You can imagine implementing without EJS or any other templating engine, but you'd probably end up re-inventing one anyhow.
The res.render()
method is synchronous, since EJS is
rendering a template using data we already have. So we can't use
asynchronous functions inside it.