The above section describes how to create a page using node + express + ejs. Today, let's take a look at how to create a simple website using node + express + jade. This article records the entire building process, for more information, see 1. create a project folder: my_jade
2. Download the express and jade packages to the local device. I personally do not like to download them to a global one. I like to download them to the project folder.
3. Create related folders and files.
Index. js:
Style.css
Gys. jade code:
Index. jade:
Layout. jade
App. js
Run app. js: node app. js;
Preview in a browser:
Here is an example of not using the page layout:
Modify index. js
Modify app. js
Run app. js and preview it in the browser:
Clicking submit triggers ajax .. This article will come here first. I will continue with the subsequent work. I am not very familiar with this content, haha.