Serve all js files from proxy server

djkramnik

29-07-2019

I would like not only to proxy to a custom nodejs server for the body of the page, but also a subset of  javascript files in the app.  How can I configure AEM to do this?

If this were sitting behind an nginx server I would just instruct it to proxy all calls to _next/runtime/**/*.js to the proxy server, while serving etc/clientLib/**/*/js calls as per normal (from AEM).  Is it possible to do this?

Accepted Solutions (1)

Accepted Solutions (1)

Jörg_Hoh

Employee

31-07-2019

Hm, that's not that easy to solve. I would try to use the Sling mappings to map the path of the resources to a different path. My guess is that it should work, but haven't tried it yet myself.

Answers (2)

Answers (2)

swaroops6390957

Employee

31-07-2019

Hi @djkramnik

I agree with Mr. Joerg Hoh's comment idea of using sling mapping. You can refer to documentation [1] to go over the details and information on how to implement it.

Regards,

Swaroop

[1]  Resource Mapping

djkramnik

08-08-2019

Ultimately I created a sling mapping that maps the path I wanted to proxy to a servlet, that actually makes the proxy call to nodejs.  It works, but interested if you have any thoughts on this approach.