该项目fork自:https://github.com/strongloop/express。
该项目用于学习之用,相对于原项目有修改。
Fast, unopinionated, minimalist web framework for node.
node的快速,unopinionated,简约的web框架。
var express = require('express')
var app = express()
app.get('/', function (req, res) {
res.send('Hello World')
})
app.listen(3000)$ npm install express- Robust routing(强大的路由选择)
- Focus on high performance(专注于高性能)
- Super-high test coverage(超高水平的测试覆盖)
- HTTP helpers (redirection, caching, etc)(http工具,如重定向,缓存等)
- View system supporting 14+ template engines(支持14个以上的模版引擎)
- Content negotiation
- Executable for generating applications quickly(快速生成应用程序可执行文件)
- Website and Documentation - [website repo] [中文文档]
- #express on freenode IRC
- Github Organization for Official Middleware & Modules
- Visit the Wiki[我的翻译]
- Google Group for discussion
- Русскоязычная документация
- 한국어 문서 - [website repo]
- Examples
PROTIP Be sure to read Migrating from 3.x to 4.x as well as New features in 4.x.
PROTIP 一定要阅读Migrating from 3.x to 4.x 和 New features in 4.x.
The quickest way to get started with express is to utilize the executable express(1) to generate an application as shown below:
最快的启动express的方法是使用可执行的express(1)生成一个应用程序,如下:
Install the executable. The executable's major version will match Express's:
安装可执行文件。可执行文件的版本要与express的相同。
$ npm install -g express-generator@4Create the app:
创建app:
$ express /tmp/foo && cd /tmp/fooInstall dependencies:
安装依赖包:
$ npm installStart the server:
启动服务:
$ npm start在浏览器中输入localhost:3000查看效果。
The Express philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, web sites, hybrids, or public HTTP APIs.
express的宗旨是提供小体积,健壮的http服务工具,使之成为单页面应用,网站,hybrids,公共http访问接口的强大解决方案。
Express does not force you to use any specific ORM or template engine. With support for over 14 template engines via Consolidate.js, you can quickly craft your perfect framework.
express不会强制你使用任何特定的orm和模板引擎。通过Consolidate.js 支持14种以上的模板引擎,可以快速的制作完美的框架。
To view the examples, clone the Express repo and install the dependancies:
查看示例,请克隆express仓库和安装依赖包:
$ git clone git://github.com/strongloop/express.git --depth 1
$ cd express
$ npm installThen run whichever example you want:
然后运行任何你想运行的示例:
$ node examples/content-negotiationTo run the test suite, first install the dependancies, then run npm test:
运行测试套件,请先安装依赖包,然后运行 npm test:
$ npm install
$ npm testThe original author of Express is TJ Holowaychuk
The current lead maintainer is Douglas Christopher Wilson
