users.js
398 字节
const router = require('koa-router')()
var userContoller = require('../controller/userController')
router.prefix('/users')
router.get('/addUser',async (ctx, next) => {
var data = await userContoller.addUser(ctx, next);
ctx.response.status = 200;
ctx.response.body = data;
})
router.get('/bar', function (ctx, next) {
ctx.body = 'this is a users/bar response'
})
module.exports = router