/mocks/myservice/* => https://my-service.com/api/*
introduce
https://github.com/wttech/acm/blob/main/ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/mock/example/service-proxy.groovy
with content like:
import javax.servlet.http.HttpServletRequest
import javax.servlet.http.HttpServletResponse
import org.apache.commons.lang3.StringUtils;
boolean request(HttpServletRequest request) {
return request.requestURI.startsWith("/mock/service/")
}
void respond(HttpServletRequest request, HttpServletResponse response) {
// use Apache Commons to build reverse-proxy here
}
/mocks/myservice/* => https://my-service.com/api/*
introduce
https://github.com/wttech/acm/blob/main/ui.content.example/src/main/content/jcr_root/conf/acm/settings/script/mock/example/service-proxy.groovy
with content like: