1 Reply Latest reply on Oct 16, 2018 2:30 AM by Peter Lundqvist

    Change the contextpath for the jetty REST api

    Peter Lundqvist
      Share This:

      I want to change the contextpath for the jetty REST api.

      What I mean by that is that I want to change /api/* to be /prefix/api/*.

      Is this possible? How do I do it?

       

      This could be achieved with URL-rewrites, but unfortunately the response body sometimes contains URL references which means that if they are followed I will have an issue.

      Looking at the jetty documentation it seems possible to set the context path, but when I look at the jetty configuration files I don't feel very confident. I will continue to experiment but any help would be appreciated.

        • 1. Re: Change the contextpath for the jetty REST api
          Peter Lundqvist

          I got asked why I wanted to do this, so here it is:

          • When you expose the REST API you will expose everything. We do not want that
          • It is non-trivial to put it behind an API manager (would be ideal)
          • Managing each api form manually takes time.
            Therefore we want to do it once, for all the environments, in a load balancer

           

          So the prefix I want to add is for the environment (production, test, development).

          Sadly, reading up on this, it looks like this is configured statically in a binary.