Build a node. js express framework + Jade template in Windows

Source: Internet
Author: User
Tags install node

1. Install node. js

It is easier to deploy node. js on the Windows platform. From 0.6.1, node. js can be directly installed on the Windows platform through the. Mis file.

Http://nodejs.org/#download the latest version is node-v0.8.3-x86.msi

The default installation path has been specified during the installation process.

Verify that node. JS is successfully installed

Open CMD and enterNode-V

2. NPM Installation

After node is successfully installed, NPM is installed by default. NPM can directly install related extensions.

Verify that NPM is successfully installed

Open CMD and enterNPM-V

3. Install Express

Open CMD and enterNPM install-G Express

-G: Install the express framework in the current directory.

Verify that express is successfully installed

After the installation is complete, close CMD and re-open

Enter cmd and enterExpress-V

Note that I use uppercase v

4. Create a project with express

1). Run cmd to enter the directory of the project to be created, and enter the express testapp (project name) directly)

2) CD testapp // enter the directory of the newly created site

3) cmd app // enter the newly created Project and enter NPM install

After that, you will find that node_modules is added to your site directory (C: \ documetns and Settings \ Administrator). This directory is the extension library file.

The default engine provided by express is the jade template engine, which subverts the traditional template engine and develops a complete set of syntaxes to produce every tag of HTML. It is powerful but not easy to learn, therefore, the syntax of using ejs templates is the same as that of ASP, JSP, and PHP, which is easy to learn. If you want to change the template engine, you can editPackage. JSONTo achieve

Run CMD in the project directory.Node app. js

Open the browser http: // 127.0.0.1: 3000/and you will be able to access it. After the environment is set up, start a new journey.

Next we choose to develop ide tools, here choose webstorm. Tutorial see: http://www.cnblogs.com/enix/archive/2012/04/29/2475983.html

========================================================== ====================

If you want to see the document and tutorials, please go to the official website:

Http://expressjs.com

The source code of Express is hosted here:

Https://github.com/visionmedia/express

Express uses the connect middleware. The CONNECT documentation is here:

Http://senchalabs.github.com/connect/

If you want to perform unit testing, you can look at the TDD framework expresso:

Http://visionmedia.github.com/expresso/

The optional Jade template engine of Express is also interesting. It is related to haml, such as an html pre-compiler:

Http://jade-lang.com/

Speaking of haml, you can also understand sass, which is like a CSS pre-compiler:

Https://github.com/visionmedia/sass.js

However, among similar products, I prefer less radical less:

Https://github.com/cloudhead/less.js

Khan ~ I just wanted to briefly introduce express.

Finally, node. JS is the prerequisite for running the above things:

Http://nodejs.org/

Related Article

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.