oly-http
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

/oly-http/

    Package Sidebar

    Install

    npm i oly-http

    Weekly Downloads

    88

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    61.7 kB

    Total Files

    58

    Last publish

    Collaborators

    • nolyme