Skip to content

Commit

Permalink
doc: patch examples
Browse files Browse the repository at this point in the history
  • Loading branch information
AxiosLeo committed Feb 2, 2024
1 parent f0b7c76 commit d3aac21
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,19 @@ app.start();
- Validation

> see [validatorjs](https://github.com/mikeerickson/validatorjs) for more rule examples
>
> see `Router` examples for more usage: [tests/bootstrap.js](tests/bootstrap.js)
```javascript
const { Router } = require("@axiosleo/koapp");

const router = new Router("/test", {
method: "any",
validator: {
// url params, like `/test/{:id}`, the 'id' is required and must be an integer
params: {
id: "required|integer",
},
query: {
name: "required|string",
},
Expand Down

0 comments on commit d3aac21

Please sign in to comment.