What is the role of App.use in the 1.express framework?
The manual reads:
App.use ([path], function) Use the given middleware function, with optional mount Path, defaulting to "/".
is to introduce a so-called middleware, is actually used to re- hack req and res objects before the actual request to achieve some functions, than if the simplest logger is to add a listener to the end event of the res write a log record, Express uses the middleware provided by Connect,
Next (); The program continues in order.
2. In regular expressions , where do the slashes "/" need to be escaped? What situations do not need to be escaped?
5
tests the regular expression. Sometimes,/this symbol needs \/to represent. Sometimes, /direct use is possible. No escaping. what situations need to be escaped?
normally /do not need to escape, unless you write JavaScript, because his patter is written "/..../", so the inside/need to escape.
only backslashes need to be escaped,/direct use can be used to use \, need to use \ \ to escape
3. How to install PM2
after installation, run pm2/pm2 list-bash pm2 command not found
NPM installed Nodejs need to manually establish a soft connection
and ln-s to/usr/local/bin.
PM2 List garbled
You can modify the format of the client encoding format to utf-8 .
App.use of the function of the regular expression/means what Nodejs pm2 how to install garbled how to solve