Skip to content

Commit d3164e4

Browse files
committed
init
2 parents e98ed78 + bdc71b3 commit d3164e4

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

doc/day1_express.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -111,33 +111,41 @@ Error handling
111111

112112
Debugging 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

doc/demo/day1/getting start/app/app.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
var oDebug = require('debug');
21
var express = require('express');
32

43
var app = express();

0 commit comments

Comments
 (0)