File tree Expand file tree Collapse file tree
demo/day1/getting start/app Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,33 +111,41 @@ Error handling
111111
112112Debugging Express
113113
114- 安装debug模块:
115-
116- $sudo npm install debug
117-
118- 然后在app.js中引入模块即可:
119-
120- var oDebug = require('debug');
121-
122- 在引入debug后,运行app.js:
114+ Expressy已经内置了debug模块,如果要用debug运行app.js:
123115
124116 $DEBUG=express:* node app.js
125117
126118![ Mou icon] ( ./images/debug1.jpg )
127119
128120### 知道如何查api文档
129121
122+ 中文文档地址
130123
124+ http://www.expressjs.com.cn
131125
132126## 核心概念
133127
128+ Express 是一个简洁、灵活的 node.js Web 应用开发框架, 它提供一系列强大的特性,帮助创建各种Web 和移动设备应用。
129+
134130### 理解public目录
135131
136132- 常规做法
133+
134+ app.use(express.static(path.join(__dirname, 'public')));
135+
136+ 来托管pubblic中得所有文件。
137+
138+
137139- 如何在静态页面处理请求参数
138140
141+ 在静态页面处理请求参数,是通过连接地址把参数传递过去,通过前端jacascript取出做处理。
142+
143+
139144理解express.static和http-server的差别
140145
146+ http-server只做静态托管文件,输出请求文件,无法拦截到请求参数;
147+ express.static不仅可以托管静态文件,并且提供接口可以拦截到前端页面的请求参数,并且可以控制返回数据;
148+
141149### 理解模板jade
142150- http://jade-lang.com/
143151
Original file line number Diff line number Diff line change 1- var oDebug = require ( 'debug' ) ;
21var express = require ( 'express' ) ;
32
43var app = express ( ) ;
You can’t perform that action at this time.
0 commit comments