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