import Router from 'koa-router';
export const router = new Router();
import './example';
import './another-route';
import './one-more-route';
import { router } from '../../router';
router.get('/example', (ctx) => {
ctx.body = { yo: 'Yo dude' };
});
router.post('/example', (ctx) => {
ctx.body = { wow: 'Some POST request goes here' };
});
import Koa from 'koa';
import { router } from './router';
import './routes';
const app = new Koa();
// body parser etc
// app.use(someMiddleware());
// app.use(moreMiddleware());
app.use(router.routes(), router.allowedMethods());
app.listen(8000);