FFFF GitHub - aqkj/bingo: 仿koa语法的deno版web框架 · GitHub
[go: up one dir, main page]

Skip to content
aqkjPublic

About

仿koa语法的deno版web框架

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

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')
});

About

仿koa语法的deno版web框架

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0