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:
- Synchronous errors are caught by Express and cause the application to go to the error handler.
- Asynchronous errors must be reported by calling next(err).
- A successfully executing middleware function tells Express to invoke the next middleware by calling next().
- A router function that returns a result to the HTTP request does not call next()