Promises class

A Promise class represents an operation that hasn’t completed yet but is expected to be completed inthe future. We know that the .then or .catch functions are invoked asynchronously when the promised result (or error) is available.
Inside and async funtion, the await keyword is available to automatically wait for a Promise to resolve. It returns the result of a Promise, or else throws errors, inthe natural location at the next line of code, while also accommodating asynchronous execution.

restApi

API stands for Application Programming Interface.
There are many types of APIs for operating systems, applications, or websites. Most operating systems provide open APIs so programmers can write applications that will be compatible with the current envirtonment.
APIs are used for Communication Between Services.
APIs can vary by architecture type (REST, SOAP, RPC, etc.), but are generally fo rone of three purposes:
System APIs, process APIs, exprerience APIs.

nodeMethod

Understanding of get and post

Get method is used when relatively non-confidential information is passed.

Once this information is submitted, you can see it in your browser’s URL.

On the other hand, POST method is used to transfer information which is relatively condfidential and you do not want the browser to cache.

If the information that you submitted is part of the URL, then it’s a GET method. If not, then it’s POST method.

Asynchronous I/O is a form of input/output processing that permits other processing to continue before the transmission has finished.

A promise is just an enhancement to callback functions in Node.js. It could help you to nest multiple callback functions together.

Basically a promise is an enhancement to callbacks that look towards alleviating these problems.

Rules that applies for Synchronous and Asynchronous

Rules in Express for handling asynchronous execution are as follows:

  1. Synchronous errors are caught by Express and cause the application to go to the error handler.
  2. Asynchronous errors must be reported by calling next(err).
  3. A successfully executing middleware function tells Express to invoke the next middleware by calling next().
  4. A router function that returns a result to the HTTP request does not call next()

MySql tutorial

1
2
3
4
5
6
7
8
9
mysql --auto-rehash -u root //set up tab completion
select <column_name> from <table_name>;
select <column_name> from <table_name> order by <column_name> ASC/DESC;
(use databases //first) Describe orders; // to show table's columns/fields
// sort data based on statuse
select <column_name> status from <table_name>
order by field(status, <'statuses'>); (in process, on hold, canceled, resolved, disputed, shipped)
// search rows
select <column_name> from <table_name> where <search_condition>;

page

Purpose: Ability to lowers development environment setup time, and increase production parity.

Vagrant
1
2
3
4
5
6
Vagrant //show available command
vagrant up
vagrant destroy
vagrant init
vagrant autocomplete install --bash --zsh
vagrant box //manage boxes (add, remove, etc.)