1.0.0 • Published 4 years ago

anfrage v1.0.0

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Anfrage

Usage

const { Anfrage } = require('anfrage');

const anfrage = new Anfrage({
  interfaces: controllers
})

Github

See Project Reference.

Example for Koa

//Get interface collection
const ctl = require("./controller")

const { Anfrage, playground } = require("anfrage")
const anfrage = new Anfrage({
  interfaces: ctl,
})

//Open test page
router.get("/anfrage", (ctx) => {
  ctx.body = playground()
})

//Request processing
router.post("/anfrage", async (ctx) => {
  const request = ctx.request.body
  const res = await anfrage.handler(request)
  ctx.body = res
})