App.use of the function of the regular expression/means what Nodejs pm2 how to install garbled how to solve

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.