1.0.7 • Published 2 years ago

@tknf/http-impl v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@tknf/http-impl

Implementations of the web standard HTTP Request and Response.

To get started, open a new shell and run:

npm install --save @tknf/http-impl
# or
yarn add @tknf/http-impl

Getting started with Node.js

const http = require("http");
const { createRequest, sendResponse } = require("@tknf/http-impl/node");

const server = http.createServer((req, res) => {
  const request = createRequest(req);
  const response = new Response("<div>Hello world!</div>", {
    headers: {
      "Content-Type": "text/html;charset=utf-8"
    }
  });
  await sendResponse(res, response);
});

server.listen(3000, () => {
  console.log("Server listening on http://localhost:3000");
});
1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago