@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)