From 64f6bd8e6457c54e0031dd7ae8eb1d83538c91be Mon Sep 17 00:00:00 2001 From: u013235949 Date: Fri, 21 Jun 2024 15:19:00 +0800 Subject: [PATCH] Fri Jun 21 15:19:00 CST 2024 inscode --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index e98f9cc..771ce74 100644 --- a/index.js +++ b/index.js @@ -6,5 +6,8 @@ console.log("欢迎来到 InsCode"); // 我们可以在这里测试它的匹配情况. // path-to-regexp 中有一个 match 函数. - +// 比如我定义了一个 /about 路由, 可以测试它的匹配情况. const fn = match("/about", { decode: decodeURIComponent }); + +console.log(fn('/about/')) // 可以匹配 +console.log(fn('/about/1')) // false \ No newline at end of file -- GitLab