w2 Flashcards
purpose of MEAN
purpose is to use only JS to cover diff parts of applications
Advantage of MEAN
- single language throughout app
2.supports MVC architecture
- Data marshalling using JSON objects- transforming the memory representation of an object into another format, which is suitable for storage
Node.js
For browser
two-way comm b/w browser and server
JS- event driven language meaning?
- event-driven language- register code to events, code executed when event is executed- allows async programming -single thread aka event loop - when there is event created sent to event queue - sends task to event handler
Why node.js?
Node.js eliminates the waiting and continues with the next request. Node.js runs single-threaded, non-blocking, asynchronously programming, which is very memory efficient.
node.js syntax, data types?
Similar to front end JS
Six data types that are primitives:
Boolean Null Undefined Number String Symbol (new in ECMAScript 2015)
and Object
What is JS primary design flaw?
design flaws is the sharing of a single global namespace
Built-in modules Node.js
Node.js has a set of built-in modules that can be used without further installation
to export?
module.exports = Student;
class name
to import?
To import a package, you have to use the required keyword
define properties of appplication in node.js?
package.json->specify the version of your current release, the name of your application, and the main application file.
how to create new package.json file?
npm init
express?
added in package.json as dependency
in node_modules file too
HTTP ?
HTTP is the abbreviation of “HyperText Transfer Protocol”.
The HTTP server is the program that serves data to clients using the HTTP protocol.
HTTP works?
client sends request to server
server accepts the request and generates a response using its local database or files
the server sends back its response to the client
the client’s browser displays/renders the response