@eggjs/router
Advanced tools
+4
-4
| { | ||
| "name": "@eggjs/router", | ||
| "version": "4.0.2-beta.9", | ||
| "version": "4.0.2-beta.10", | ||
| "description": "Router middleware for egg/koa. Provides RESTful resource routing.", | ||
@@ -52,5 +52,5 @@ "keywords": [ | ||
| "typescript": "^5.9.3", | ||
| "@eggjs/koa": "3.1.2-beta.9", | ||
| "@eggjs/tsconfig": "3.1.2-beta.9", | ||
| "@eggjs/supertest": "9.0.2-beta.9" | ||
| "@eggjs/koa": "3.1.2-beta.10", | ||
| "@eggjs/tsconfig": "3.1.2-beta.10", | ||
| "@eggjs/supertest": "9.0.2-beta.10" | ||
| }, | ||
@@ -57,0 +57,0 @@ "engines": { |
+6
-6
@@ -140,6 +140,6 @@ # @eggjs/router | ||
| }, | ||
| ctx => { | ||
| (ctx) => { | ||
| console.log(ctx.user); | ||
| // => { id: 17, name: "Alex" } | ||
| } | ||
| }, | ||
| ); | ||
@@ -303,3 +303,3 @@ ``` | ||
| methodNotAllowed: () => new Boom.methodNotAllowed(), | ||
| }) | ||
| }), | ||
| ); | ||
@@ -323,3 +323,3 @@ ``` | ||
| ```ts | ||
| router.all('/login', ctx => { | ||
| router.all('/login', (ctx) => { | ||
| ctx.redirect('/sign-in'); | ||
@@ -413,6 +413,6 @@ ctx.status = 301; | ||
| }) | ||
| .get('/users/:user', ctx => { | ||
| .get('/users/:user', (ctx) => { | ||
| ctx.body = ctx.user; | ||
| }) | ||
| .get('/users/:user/friends', ctx => { | ||
| .get('/users/:user/friends', (ctx) => { | ||
| return ctx.user.getFriends().then(function (friends) { | ||
@@ -419,0 +419,0 @@ ctx.body = friends; |
82065
0.02%