2.4.0 • Published 1 year ago
@mutoe/koam-router v2.4.0
Koam-router
Implement a simple Koa-like router to create a web application.
THIS FRAMEWORK HAVE NOT BEEN STRICTLY TESTED, PLEASE DO NOT USE IT IN PRODUCTION ! 许多功能未经严格测试,请勿用于生产目的!
Usage
import Koa from '@mutoe/koam-core'
import Router from '@mutoe/koam-router'
const app = new Koa()
const router = new Router()
app.use(router.routes())Roadmap
new Route([options])options.prefixoptions.exclusiveoptions.host
router.<get|post|put|patch|delete|all>(path, ...middlewares)- Named routes
- Match host
- Multiple middlewares
- Path matching (lightweight
path-to-regexp)- named match
- unnamed match
- custom pattern match
- modifiers
context.paramsrouter.routes()- Nested routes
router.use([path], ...middlewares)router.use([path], ...anotherRouter.routes())
router.prefix(path)router.allowedMethods([options])options.throwoptions.notImplementedoptions.methodNotAllowed
router.redirect(source, destination, [status])router.route(name)router.url(name, params, [options])router.url(name, ...paramStrings, [options])options.query
- static method
Router.url(path, params, [options])Router.url(path, ...paramStrings, [options])options.query
router.param(param, ...middlewares)
2.4.0
1 year ago
2.3.1
1 year ago
2.2.0
2 years ago
2.0.2
2 years ago
2.1.0
2 years ago
2.0.1
2 years ago
2.0.0
2 years ago
2.0.0-alpha.0
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
0.3.2
3 years ago
0.3.1
3 years ago
0.3.0
3 years ago
0.2.4
3 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.4
3 years ago