|
3 | 3 | Router core component for [Egg.js](https://github.com/eggjs). |
4 | 4 |
|
5 | 5 | > **This repository is a fork of [koa-router](https://github.com/alexmingoia/koa-router).** with some additional features. |
6 | | -
|
7 | | -> And thanks for the greate work of @alexmingoia and the original team. |
| 6 | +> And thanks for the great work of @alexmingoia and the original team. |
8 | 7 |
|
9 | 8 | ## API Reference |
10 | 9 |
|
11 | | -* [egg-router](#module_egg-router) |
12 | | - * [Router](#exp_module_egg-router--Router) ⏏ |
13 | | - * [new Router([opts])](#new_module_egg-router--Router_new) |
14 | | - * _instance_ |
15 | | - * [.get|put|post|patch|delete|del](#module_egg-router--Router+get|put|post|patch|delete|del) ⇒ <code>Router</code> |
16 | | - * [.routes](#module_egg-router--Router+routes) ⇒ <code>function</code> |
17 | | - * [.use([path], middleware)](#module_egg-router--Router+use) ⇒ <code>Router</code> |
18 | | - * [.prefix(prefix)](#module_egg-router--Router+prefix) ⇒ <code>Router</code> |
19 | | - * [.allowedMethods([options])](#module_egg-router--Router+allowedMethods) ⇒ <code>function</code> |
20 | | - * [.redirect(source, destination, [code])](#module_egg-router--Router+redirect) ⇒ <code>Router</code> |
21 | | - * [.route(name)](#module_egg-router--Router+route) ⇒ <code>Layer</code> | <code>false</code> |
22 | | - * [.url(name, params, [options])](#module_egg-router--Router+url) ⇒ <code>String</code> | <code>Error</code> |
23 | | - * [.param(param, middleware)](#module_egg-router--Router+param) ⇒ <code>Router</code> |
24 | | - * _static_ |
25 | | - * [.url(path, params)](#module_egg-router--Router.url) ⇒ <code>String</code> |
| 10 | +- [@eggjs/router](#eggjsrouter) |
| 11 | + - [API Reference](#api-reference) |
| 12 | + - [Router ⏏](#router-) |
| 13 | + - [new Router(\[opts\])](#new-routeropts) |
| 14 | + - [router.get|put|post|patch|delete|del ⇒ Router](#routergetputpostpatchdeletedel--router) |
| 15 | + - [Named routes](#named-routes) |
| 16 | + - [Multiple middleware](#multiple-middleware) |
| 17 | + - [Nested routers](#nested-routers) |
| 18 | + - [Router prefixes](#router-prefixes) |
| 19 | + - [URL parameters](#url-parameters) |
| 20 | + - [router.routes ⇒ function](#routerroutes--function) |
| 21 | + - [router.use(\[path\], middleware) ⇒ Router](#routerusepath-middleware--router) |
| 22 | + - [router.prefix(prefix) ⇒ Router](#routerprefixprefix--router) |
| 23 | + - [router.allowedMethods(\[options\]) ⇒ function](#routerallowedmethodsoptions--function) |
| 24 | + - [router.redirect(source, destination, \[code\]) ⇒ Router](#routerredirectsource-destination-code--router) |
| 25 | + - [router.route(name) ⇒ Layer | false](#routerroutename--layer--false) |
| 26 | + - [router.url(name, params, \[options\]) ⇒ String | Error](#routerurlname-params-options--string--error) |
| 27 | + - [router.param(param, middleware) ⇒ Router](#routerparamparam-middleware--router) |
| 28 | + - [Router.url(path, params \[, options\]) ⇒ String](#routerurlpath-params--options--string) |
| 29 | + - [Tests](#tests) |
| 30 | + - [License](#license) |
26 | 31 |
|
27 | 32 | <a name="exp_module_egg-router--Router"></a> |
28 | 33 |
|
@@ -412,3 +417,7 @@ const url = Router.url('/users/:id', {id: 1}, {query: { active: true }}); |
412 | 417 | ## Tests |
413 | 418 |
|
414 | 419 | Run tests using `npm test`. |
| 420 | + |
| 421 | +## License |
| 422 | + |
| 423 | +[MIT](LICENSE) |
0 commit comments