mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-10 04:22:12 +00:00
[now dev] Use pcre-to-regexp to match routes (#2027)
* [now dev] Use `pcre-to-regexp` to match `routes` The now.json `routes` support PCRE syntax like named captures, so use the `pcre-to-regexp` module to match the routes. Fixes #2023. * Pass the resolved router `dest` and query params to the Lambda
This commit is contained in:
committed by
Leo Lamprecht
parent
6c8dc90267
commit
fd3c110c02
@@ -36,7 +36,7 @@ test('[dev-router] captured groups', t => {
|
||||
|
||||
test('[dev-router] named groups', t => {
|
||||
const routesConfig = [
|
||||
{ src: '/user/(?<id>.+)', dest: '/user.js?id=$<id>' }
|
||||
{ src: '/user/(?<id>.+)', dest: '/user.js?id=$id' }
|
||||
];
|
||||
const result = devRouter('/user/123', routesConfig);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user