We have a Play 2.6 Java application that works great so far.
Now we need to add some route to it that will just be taking the original request, decorating it with some additional headers or whatever and sending it forward to be handled by some other app (probably using Play’s WS client)
The question is if it is possible to create some route like this one in the Play routes file:
* /forward-to-smth/*whatever my.Action.forward
where * will match all the HTTP Methods, and we’ll be just getting the Http.Request instance in the action body and handling it as required.
What is the best way of handling this kind of scenarios in Play?
We can probably create multiple routes’ entries for each HTTP method and multiple actions in in the controller for each of the methods, delegating all the handling to a single handle-it-all method, but is there any more elegant solution?
Creating some custom HttpRequestHandler for this case will probably be an overkill?