In order to create a cors entry, we created a file:
/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl-myapp.cfg.json
When we deploy the project to the local author instance using mvn clean install -PautoInstallSinglePackage in the root, then look in the config manager, it is not there. Should it be?
Here I am assuming that when you run the AEM SDK locally, its in dev run mode.
above is only a config which was manually created. We would expect our mypp config to also be there.
The contents were this:
{
"alloworigin":["*"],
"alloworiginregexp":[],
"allowedpaths":[".*"],
"exposedheaders":[""],
"maxage":1800,
"supportedheaders":["*"],
"supportedmethods":["GET","POST"],
"supportedcredentials":"true"
}
Solved! Go to Solution.
Views
Replies
Total Likes
Hello,
Just to add, the local config file name should not have "-" in the file name rather use "~" to make it work. so create the file name as
/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl~myapp.cfg.json
Hi @TB3dock ,
Please have a check in crx if the newly created config is available in the below path.
/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl-myapp.cfg.json
Also please confirm if your local instance run mode is set to dev?
Views
Replies
Total Likes
.
Hi @TB3dock ,
It should be available in config Manager.
you should keep the file in the part mentioned by @Vaibhavi_J .
and make sure you are building all the modules in maven not only the ui.apps.
it should deploy it to config Manager. Also, check-in CRXDE if you are able to see this in osgiconfig node.
Thanks,
Prince
Hi @TB3dock
Your configuration is created under config.author.dev which will be used only for the developement author environment.
/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl-myapp.cfg.json
if your current instance is running on dev, author runmode, you will be able to see the above config under system/console/configMgr, else it will not be picked by the instance even though it is present under /apps/myapp/osgiconfig/config.author.dev
if you want it to be available on your local author instance, put it either to /apps/myapp/osgiconfig/config or create a new run mode such as /apps/myapp/osgiconfig/config.author.local and set the run mode in the sling.properties file as a property like "sling.run.modes=local, author"
Hope this helps!
Thanks
We assume because we are running the author instance locally, it must be in dev mode, as its not stage or prod, and there are only 3 possibilities. We don't have a sling.propertiers file currently.
Views
Replies
Total Likes
Hi @TB3dock
In felix console navigate to Status -> Sling Setting else navigate to http://localhost:4502/system/console/status-slingsettings URL
It will have a poperty as Run Modes
Run Modes = [s7connect, crx3, author, samplecontent, crx3tar]
If you have only the above values, then the config should work. If you have dev in the above entry then it will be considered as the development environemnt and config.author.dev runmode will be picked.
Views
Replies
Total Likes
Hello,
Just to add, the local config file name should not have "-" in the file name rather use "~" to make it work. so create the file name as
/myapp.ui.config/src/main/content/jcr_root/apps/myapp/osgiconfig/config.author.dev/com.adobe.granite.cors.impl.CORSPolicyImpl~myapp.cfg.json
Hi
local AEM SDK does not contain dev run mode by default. you can set though using command line when you start aem or set in sling:properties file.
you can varify run modes on instance at http://localhost:4502/libs/granite/operations/content/systemoverview.html
Views
Replies
Total Likes
Views
Likes
Replies