1 Star 0 Fork 236

Juant / sureness

forked from anjun / sureness 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
path-match.md 1.33 KB
一键复制 编辑 原始数据 按行查看 历史

URI Path Match

We treat restful requests as a resource, resource format like requestUri===httpMethod.
That is the request uri + request method(post,get,put,delete...or *, * match all request method) is considered as a resource as a whole.
eg: /api/v2/book===get, /api/v3/book===*
The requestUri here support url path match: str*str, *, **

Wildcard Describe
str*str the * in string match 0 or more characters
* Match 0 or 1 directories
** Match 0 or more directories
Sample Note
*.html can match content.html, user-ui.html etc
/api/*/book can match /api/user/book or /api/book etc
/** can match any path
/**/foo can match /api/user/book/foo etc

Match priority: Raw string > *.html > * > **
Longest path matching principle:
eg: when requestUri is /app/book/foo,If there are two matching patterns - /app/** and /app/book/*,will match/app/book/*

Java
1
https://gitee.com/juant/sureness.git
git@gitee.com:juant/sureness.git
juant
sureness
sureness
master

搜索帮助