修改路由匹配正则表达式,添加更多测试用例

This commit is contained in:
yangshangbo
2025-04-15 14:08:42 +08:00
parent 8b18de9693
commit d1da1e9bc1
4 changed files with 18 additions and 8 deletions
+6
View File
@@ -3,6 +3,12 @@ import hono
fn main() {
mut hono_app := hono.Hono{}
hono_app.get('/article/:id', fn (req hono.Request) http.Response {
println('Request url: ${req.url}')
println('Query map: ${req.query}')
println('Param map: ${req.param}')
return hono.Response.text('Hello, GET request! id = ${req.param['id']}, q = ${req.param['q']}')
})
hono_app.get('/api/**/:folder/user', fn (req hono.Request) http.Response {
println('Request url: ${req.url}')
println('Query map: ${req.query}')