diff --git a/index.js b/index.js index e98f9cc885e12a75a50688c155765241e735a8cd..771ce7441d3645262f5033eace60a366b1bf759e 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