HTTP, NPM, NODE, Express Flashcards
What is a client?
A service requestor.
What is a server?
A service provider.
Which HTTP method does a browser issue to a web server when you visit a URL?
a get request
What three things are on the start-line of an HTTP request message?
The method, verbs i.e. GET PUT, POST or a noun HEAD, OPTIONS, the target (URL), HTTP version
What three things are on the start-line of an HTTP response message?
Version ie. (HTTP/1.1),
status code (404),
status text i.e. 404 Not found (for human reading)
What are HTTP headers?
A string followed by colons and a value.
A key value pair.
Where would you go if you wanted to learn more about a specific HTTP Header?
MDN
Is a body required for a valid HTTP request or response message?
No. Their could just be a confirmation in the start line.
What is AJAX?
Asynchronus processing request, to load data with having a user reload a page.
What does the AJAX acronym stand for?
Asynchronous JavaScript And XML
Which object is built into the browser for making HTTP requests in JavaScript?
XMLHttpRequest object.
What event is fired by XMLHttpRequest objects when they are finished loading the data from the server?
load event.
Bonus Question: An XMLHttpRequest object has an addEventListener() method just like DOM elements. How is it possible that they both share this functionality?
Prototype inheritance from the window.
What is NPM?
Node-package manager.
What is a package?
A directory with one or more files, of a chunk of reusable code.
How can you create a package.json with npm?
What is a dependency and how do you add one to a package?
A package that your package requires you to use. Version control, majorversion(breaking changes).minorversion(adds functionality backwards compat).bugfixversion(fixes something, should always update this)
What happens when you add a dependency to a package with npm?
It gets put into your package.json, and downloads the package and all dependencies in your node-modules.
What are some other popular package managers?
Yarn and PNPM.
DEV dependencies.
Packages for when your in development, so they can easily removed at launch.
Scripts in npm?
Scripts allow you to create shortcut keywords to run different packages.
What is Express useful for?
Handling server requests.