🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@eggjs/router

Package Overview
Dependencies
Maintainers
9
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@eggjs/router - npm Package Compare versions

Comparing version
4.0.2-beta.9
to
4.0.2-beta.10
+4
-4
package.json
{
"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": {

@@ -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;