Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Building an URL with parts from the path

Using zuul, is it possible to configure routes to use parts from the path in the url?

This meta code config using normal regexp explains what I'd like to do.

zuul:
  routes:
    foobar:
      path: /foo/{.*}/bar/{.*}
      url: http://foobar/\2/\1

So /foo/123/bar/456 would be routed to http://foobar/456/123

like image 966
Andreas Wederbrand Avatar asked Oct 19 '17 09:10

Andreas Wederbrand


1 Answers

You can write your own routing filter, example: https://cloud.spring.io/spring-cloud-netflix/multi/multi__router_and_filter_zuul.html#_how_to_write_a_route_filter

like image 50
Jeff Avatar answered Nov 10 '22 21:11

Jeff