Routing is a fundamental aspect of Express. This lesson demonstrates how to define dynamic routes and access route parameters in your code.
maybe its just that im a newb did i miss something where i was supposed to fork and clone a repo for this lesson? i am coding along with the guy so all of a sudden he has a user.json file in the second lesson. i went to github and just copied it to where im doing the lesson but that wasn't entirely obvious. i make this comment only because this is a beginner level course. But like i said maybe i missed instructions somewhere.
No Benjamin. The problem is that he doesn't doing a step by step course. What he does is to copy and paste code he thinks is no important. I think its a pretty bad approach for a beginners tutorial.
I agree this is not a good practice for beginners, though maybe that isn't the target audience. But there is a lot of assumptions in those first 15 seconds. Anyway, to support anyone trying to keep up:
npm install --save file-system lodash
var fs = require('file-system')
(or ('fs')
as per video) and
var _ = require('lodash')
How is it possible to have "user.name.full" value. We are not creating this variable there, because there isn't any var keyword before the name, first and last are the properties of name object, but where does full property come ?
@Tahsin he's pulling it from the users.JSON file
@Tahsin, yes we do in readFile
line #12