yutent 0619b424fe | ||
---|---|---|
lib | ||
.gitignore | ||
LICENSE | ||
Readme.md | ||
index.js | ||
package.json |
Readme.md
@gm5/response
@gm5/response
对Http的response进一步封装, 提供常用的API.
安装
npm install @gm5/response
使用
import Response from '@gm5/response'
import http from 'http'
http
.createServer((req, res) => {
let response = new Response(req, res)
response.type = 'html'
response.body = '<h1>hello world</h1>'
})
.listen(3000)