Skip to content

Commit

Permalink
fix: add jwt doc
Browse files Browse the repository at this point in the history
  • Loading branch information
npmstudy committed Nov 14, 2023
1 parent c6df21f commit ef4adff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,17 @@ const rpc = createServer(cfg);
rpc.start();

```

jwt豁免

```js
rpc.jwt(async (ctx, next) => {
// console.dir('view');
await next();
// if (['/', '/view', '/api*'].some((e) => ctx.path.match(e))) {
// await next();
// } else {
// ctx.body = { jwt: 'not jwt' };
// }
});
```

0 comments on commit ef4adff

Please sign in to comment.