1.0.0 • Published 1 year ago

pfc-http-adapter v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

HTTP Adapter

Koa-based library provides the necessary framework for Query Side services to be created.

Requirements

  • Typescript
  • Koa
  • Pino (Logger)

Setup

To install, use the file pro package.json option in the project:

  "dependencies": {
    "http-adapter": "file:../../libs/http-adapter",
    ...
  }

How to Use

To use it, you need to create a Mapper of the routes and functions to be executed:

import { HttpAdapter } from "http-adapter";

const MyQueryMapper = {

  "/myroute/": MyCallableFunction,

};

HttpAdapter({
  QueryMapper: MyQueryMapper,
}).listen(8080);

Note: All routes will be mapped and built using the GET method.