- factory function
- middleware
- http server
- what’s harp
- how to use it
- Meet the Connect Framework
- how to use
connect
to add amiddleware
Transfer-Encoding: chunked
- HTTP 303 status && Location Header
- wiki link
- in server-static: to modify pathname and redirect to it.
–save: Package will appear in your dependencies.
–save-dev: Package will appear in your devDependencies.
!==
vs||
/* version !==:
only b = flase then a = flase, else a = true, so defalut is true;
and the most important you only have choice of true or flase;
it is very useful if you are setting a boolean value in options.
*/
var a = false !== b;
var a = true !== b; //defalut is false;
/* version ||
flase: b = undefined or 0 or null or false then a = flase else a = b , defalut is false,
this mothod can not solve defalut is true.
*/
var a = b || false;
var a = b || true; //are you kidding?
- support
GET
,HEAD
- require ‘url’
url.parse
to get a url object?- and then you can use
Object.pathname
url.format
- require ‘send’
next
,next()
- next(err)
exports.mime
- provide MIME type : to deal with non ASIC2 docutment.
escape()
- to replace some words to other words…
- fs.readFile里面的 data 无法传出去? **!回调会在你后面赋值之后才执行啊!
- 不指名statuscode的话是如何返回状态码的?
- how it run?
- why not use it ?