Grails Serve Static Contents from WebServer from ApplicationResources.groovy -
we have web server static files (css/js/images). obtain war grails command , delete static web-app contents application (in build.xml). thought resources redirected static/js/ or static/css/ complains js/ or /css/ cannot found.
we don't want have duplicates under application , web-server. how force grails @ external directory in applicationresources.groovy?
the web server overrides static contents if files present under application.
use below configuration in config.groovy
:
grails.resources.work.dir = "path/for/static/assets/in/web/server"
refer configuration page of resources plugin details. however, in future, if decide migrate use asset-pipeline plugin instead of resources plugin use below configuration:
grails.assets.url = "path/for/static/assets/in/web/server"
refer docs details.
Comments
Post a Comment