anfrage
v1.0.0
Published
Learn from Graphql. Try to rely entirely on JSON front-end/back-end interaction
Downloads
1
Readme
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
})