1. Establish the Engineering folder My_ejs.
2. First use NPM install Express and NPM install Ejs
Download these two guys. As to whether to set a global, look habits, I habitually downloaded to 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 to publish an article:
Click Publish, jump to the home page.
Okay, so far, a simple "website" is out.
A heartfelt complaint: Learning Express+ejs is really too difficult, get a book on the top of the knock, how do not come to the expected effect; a long time to know, the original express+ejs has been changing, the only authority is the official website, but the official online said not much, but also in English, can not understand .
Do the small partners have a new understanding of Node+express+ejs? To tell the truth I am not too will, has been stones, this article is only to give you a reference.