UNPKG

@reportfy/tester

Version:

Lib para teste de integração usando serviço do reportfy

28 lines (17 loc) 438 B
const Koa = require('koa'); const koaBody = require('koa-body'); const app = new Koa(); const Router = require('koa-router'); app.use(koaBody()); // Prefix all routes with: /books const router = new Router({ prefix: '/api' }); router.get('/user', (ctx, next) => { ctx.body = {name: 'hello world'} next(); }); // Use the Router on the sub route /books app.use(router.routes()); app.listen(3000); module.exports = app