BANKI
15 flashcards · Computer Science · by Hunter Burningham
NPM package Express
A web framework makes routes
Connect-mongo
store sessions in db so when server resets, dont get logged out
express-handlebars
templating engine
express-session
for sessions and cookies
dot-env
config and environment variable secrets
method-override
allows put and delete
moment
used to format dates
morgan
logging package
passport
authentication package
nodemon
dev dependency, installed via npm -i -D nodemon cross-env (different depending on mac or windows hence cross-env)
start in prod
"cross-env NODE_ENV=production node app"
start in dev
"cross-env NODE_ENV=production nodemon app"
exit with failure
process.exit(1)
mongoose returns a promise so its best to use
async/await
Lexical Environment
Where the code sits, and what surronds it. In javascript, the lexical environment is important. The compiler cares where your code sits.