I. Express FRAMEWORK
As already described in the previous sections, you can use NPM to install the node. JS module. For more details, please refer to the previously written Nodejs introduction.
Express is a Nodejs Web-open source framework for building Web projects quickly. The main integration of the Web's HTTP server creation, static text management, server URL address request processing, get and POST request processing distribution, session processing and other functions.
Using the method, open the path to the Web project you want to create in CMD. And then enter
Express AppName
You can create a Web project named appname. Console Print Results
Enter appname folder input in cmd
Node Appname.js
Return results such as to indicate successful installation!
Such problems often arise in the development of a project
This error indicates that the relevant module is not installed and the workaround is to open the project folder on CMD and enter
NPM Install Express
After successful installation, a node_modules is generated under this file path, which contains the express framework code.
Other modules can also be installed in a similar way, and the installation path is also under Node_modules.
Second, Jade module
Jade is a high-performance, simple-to-understand template engine. You can write HTML files by using Jade.
Jade resembles a language for writing HTML quickly, with the following file suffix. Jade.
The following is the contents of the file
In the cmd input, the compressed can be by adding-p to do not compress, if each change the template to hit the command line a very troublesome is not, we can add Jade-p-W jade.jade plus a-w to open the monitoring mode, each time you change the template, the HTML file will be automatically compiled
The resulting HTML file is as follows:
Introduction to the Nodejs native module