0

I'm trying to hit my rest service running locally on

http://localhost:8080 

with an ajax request as such

$.ajax({
    type: "GET",
    url: "/api/test",
    dataType: "json",
    success: function(testData) {
        callback(testData);
    }
});

Where I get the json data back from

http://localhost:8080/api/test. 

This works fine if I add this rule to my http.conf file

ProxyPass /api/test http://localhost:8080/api/test

However I have mutiple endpoints I would like to hit at

http://localhost:8080/api/*

Is there a general rule I can add that will allow me to hit everything at /api/* without having to enter in a separate rule for every endpoint like this:

ProxyPass /api/test/foo http://localhost:8080/api/test/foo
ProxyPass /api/bar http://localhost:8080/api/bar
etc.

Thanks!

user1875195
  • 968
  • 4
  • 8
  • 22

1 Answers1

0

If you replace

ProxyPass /api/test http://localhost:8080/api/test

by

ProxyPass /api http://localhost:8080/api

then anything that starts with /api will be correctly redirected.

lacton
  • 2,316
  • 2
  • 22
  • 24