How to Allow ClientLib that is under /apps.. component level in Dispatcher.any file

Avatar

Avatar

tushaar_srivastava

Avatar

tushaar_srivastava

tushaar_srivastava

29-01-2020

Hi,

As previously we were creating clientLibs under /etc/designs, and to allow these styles in dispatcher : we use to allow something like

# design and template assets
/0050 { /type "allow" /glob "GET /etc/designs/*" }

# collected JS/CSS from the components and design
/0051 { /type "allow" /glob "GET /etc/clientlibs/*" }

 

 Now, since we moved all the clientLibs specific to component level.

exmaple:  /apps/myproject/clientLibs or /apps/myproject2/clientLibs2 or /apps/myproject3/clientLibs3

 

In that case how to allow all the clientlibs in dispatcher.any file, ClientLibs i.e. under the /apps folder to different different component.

 

Thanks

 

@kautuk_sahni  @Arun_Patidar 

Clientlib.min.css Dispatcher dispatcher.any

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

asutosh_jena

Avatar

asutosh_jena

asutosh_jena

29-01-2020

Hi @tushaar_srivastava ,

 

Clientlibs under /apps should have the "allowProxy" property and will be invoked via a proxy servlet.
It is recommended to locate client libraries under /apps and expose them via /etc.clientlibs by leveraging the allowProxy property.

So if the file is like /apps/projects/clientlibs/base/resources/icon.png then it will be accessed via /etc.clientlibs/projects/clientlibs/base/resources/icon.png

 

Along with this you will need to add the below rules in dispatcher.

  1. under filter section allow the below path:
    /0002 { /type "allow" /url "/etc.clientlibs/*" }
  2. under rules section allow the below paths:
    /0001 { /glob "/etc.clientlibs/*.css" /type "allow" }
    /0002 { /glob "/etc.clientlibs/*.js" /type "allow" }

Please refer the below link for more details:

https://docs.adobe.com/content/help/en/experience-manager-65/developing/introduction/clientlibs.html...

 

Thanks,

Asutosh

Answers (0)