response/Readme.md

524 B

downloads version

@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)
对Http的response进一步封装, 提供常用的API
JavaScript 100%