1. Set up the project folder My_ejs.
2. First use NPM install Express and NPM install Ejs
Download these two guys. As to whether to set up a global, to see the habit, I habitually downloaded into the folder in this project My_ejs.
Then create the appropriate file:
Index.js:
Form.ejs:
Index.ejs
App.js:
Start Running App.js
Node App.js, and then browser-side access: localhost:1337
Click Post article:
Click on the post to jump to the homepage.
OK, so far, a simple "website" is out.
Heartfelt complaint: Learning Express+ejs really is too difficult, get a book on the above knock, how can not come out the expected effect; for a long time to know, the original express+ejs has been changing, the only authority is the official website, but the official web site said not many, and are English, and do not understand .
Node+express+ejs to build a simple "page"