Node+express+ejs to build a simple "page"

Source: Internet
Author: User

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"

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.