alioth/before/cha/10=paccommand/routes/index.js
2025-05-30 09:18:01 +08:00

20 lines
327 B
JavaScript

const router = require('koa-router')()
router.get('/', async (ctx, next) => {
await ctx.render('index', {
title: 'X71291'
})
})
router.get('/string', async (ctx, next) => {
ctx.body = 'koa2 string'
})
router.get('/json', async (ctx, next) => {
ctx.body = {
title: 'koa2 json'
}
})
module.exports = router