If you are wondering where the data of this site comes from, please visit GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Ethan Brown EthanRBrown @vms Portland, OR

EthanRBrown/learning-javascript-3e 22

Companion repository to Learning JavaScript, 3rd Edition.

EthanRBrown/git-policy 2

Command-line Git wrapper that allows enforcing configurable project policy.

EthanRBrown/directory-tree-promise 1

Asynchronously return a directory tree as a JS object

EthanRBrown/excel4node 1

Node module to allow for easy Excel file creation

EthanRBrown/fetch-vs-xhr-example 1

Example of Fetch vs XHR APIs

EthanRBrown/gitopia 1

Yet another JavaScript Git wrapper.

EthanRBrown/arrayset.js 0

A dependency-free JavaScript library for treating arrays like sets and performing set operations with an intuitive interface.

EthanRBrown/collywobbles-grant 0

Dr. Collywobbles Computer Literacy Program! Personalized for Grant!

fork EthanRBrown/exceljs

Excel Workbook Manager

fork in a month

create barnchEthanRBrown/fetch-vs-xhr-example

branch : main

created branch time in 2 months

created repositoryEthanRBrown/fetch-vs-xhr-example

Example of Fetch vs XHR APIs

created time in 2 months

issue commentEthanRBrown/web-development-with-node-and-express-2e

Testing home page renders after adding sessions

Hi, Trang, thank you for the question! I’m at the airport, leaving for my first post-pandemic trip, and I don’t have my laptop with me (hooray)! I’ll be back on the 6th & will take a look at your question then. Sorry for the delay, and thank you for your patience!

On Thu, Jul 1, 2021 at 2:57 AM Trang Le ***@***.***> wrote:

In chapter 10, we introduced sessions:

// meadowlark.js

app.get('/', (req, res) => { const cart = req.session.cart || { items: [] } const context = { products, cart } res.render('home', context) })

Assuming that we still have the test file at tests/handlers.test.js, running the test now would fail with the following error:

TypeError: Cannot read property 'cart' of undefined

because req.session is undefined.

What can I do in this case?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe .


comment created time in 3 months