Skip to content

Latest commit

 

History

History
31 lines (26 loc) · 562 Bytes

README.md

File metadata and controls

31 lines (26 loc) · 562 Bytes

bingo

仿koa语法的deno版web框架

Hello Bingo

import { Bingo, Router } from 'https://deno.land/x/bingo/mod.ts'
const app = new Bingo()
const router = new Router()
router.get('/', (ctx, next) => {
  ctx.body = 'home'
})
router.post('/news/:id', async (ctx, next) => {
  ctx.body = 'news' + ctx.params.id
  await next()
}, (ctx, next) => {
  console.log(ctx.params.id)
})
// response
app.use(async ctx => {
  ctx.body = 'Hello Bingo'
  await next()
})
app.use(router.routes())
app.listen(3000, () => {
  console.log('端口监听3000')
});