We have a web server for static files (css/js/images). We obtain the war from the Grails command and delete the static web-app contents from application (in build.xml). I thought resources will be redirected to static/js/ or static/css/ but it complains that js/ or /css/ cannot be found.
We don't want to have duplicates under application and web-server. How to force Grails to look at external directory in ApplicationResources.groovy?
The Web server overrides static contents only if files are already present under Application.
Use below configuration in Config.groovy
:
grails.resources.work.dir = "path/for/static/assets/in/web/server"
Refer the configuration page of resources plugin for details. However, in future, if you decide to migrate to use asset-pipeline plugin instead of resources plugin then use below configuration:
grails.assets.url = "path/for/static/assets/in/web/server"
Refer docs for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With