Expand my Community achievements bar.

SOLVED

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

Avatar

Level 7

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  @arunpatidar 

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

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

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

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