javascript - http-proxy-middleware path matching problem
大家讲道理
大家讲道理 2017-06-12 09:31:33
0
2
797

I enabled the express server locally and added http-proxy-middleware to act as a proxy, but there were some problems with the matching path





{ context:'^.*/ajax-.*', options:{ target:'http://xxxxx:xxxx' } }

    

This can successfully match the address in the format of xxx/ajax-xxx. But if the address becomes xxx/ajax-xxx/xxx, it cannot be matched. It seems that it can only match one /. I don’t know why. Please help.

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(2)
phpcn_u1582

'^.*/ajax-.*/**'

伊谢尔伦

This is the current solution, it just feels very awkward. . If you have a good way, I’ll add it here

context:['^.*/ajax-.*','^.*/ajax-.*/*','^.*/ajax-.*/*/*']
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template