From d3aac21afe5d1a2c2e0937b92209dbc64d7643c9 Mon Sep 17 00:00:00 2001 From: axiosleo Date: Fri, 2 Feb 2024 13:52:30 +0800 Subject: [PATCH] doc: patch examples --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index c829c1a..757cd7d 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,8 @@ 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"); @@ -62,6 +64,10 @@ 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", },