oly-http

HTTP Server and Client.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
oly-http
8121.1.06 years ago8 years agoMinified + gzip package size for oly-http in KB

Readme

oly http
HTTP Server and Client.
oly http is a module of the oly project.
import { Kernel } from "oly";
import { HttpClient, HttpServerProvider } from "oly-http";

const kernel = Kernel.create({HTTP_SERVER_PORT: 4040});
const server = kernel.get(HttpServerProvider);     // koa
const client = kernel.get(HttpClient);             // axios

kernel
  .configure(() =>
    server.use(ctx => ctx.body = "Hello World"))   // koa middleware
  .start()
  .then(() =>
    client.get(server.hostname))                   // axios#get
  .then(console.log);

Installation

$ npm install oly oly-http

Dependencies

| | | |--|--| | HTTP Client | axios | | HTTP Server Framework | koa |