node Flashcards
What is a web server?
A web server is a program that understands URLs and can read HTTP requests.
Describe the HTTP requests/response lifecycle.
The browser sends an http request to the web server.
Server handles the request based on the /path and http method in request
The handler function executes, possibly interacts with DB.
Response data is formatted, Response status set.
Response sent back to browser.
Tell me about a time when you’ve used Express Router. How was it helpful?
used for shower thoughts, helps to keep things organized mentally and also keep code organized
What is postgreSQL
an open source database management system
what is SQL
a querying languge used to interact with, manipulate a
relational database
what is knex
a SQL query builder used for postgres
what is the cors dependency?
an npm package to enable cors - cross origin resource sharing. sharing resources between different sites
what are environment variables? how can you use them?
environment variables are variables only accesible in certain environments and are stored in .env files. used for storing sensitive information securely
what is the dotenv dependency?
an npm module used for storing and reading .env files , environment variables
what is the helmet dependency?
the helmet npm module is used to hide information about the backend from potential malicious hackers by setting certain http headers
endpoint logic
app.get(‘/route’, (req, res) => { logic, do something with req, res }
npm i pg
used with knex. knex can be used with different database management systems, the pg specifies that we’re using the postgres driver