(Quick Reference)

baseurl mapper

The baseurl mapper can be used to prefix and/or absolutize any links generated for resources.

You commonly use this with a pull CDN that will serve your resources for you (from these absolute links you generate) and when necesary it will request the original resource from your app. So Resources still processes it all and serves it up to the CDN, but all your clients see links to the CDN.

If you are not using a CDN you do not need to use or configure this mapper.

Config options

There are two mapper config values for this mapper:

grails.resources.mappers.baseurl.default = "http://default.prefix.for.links.com"

This sets the fall back default prefix to apply to all links unless there is another specified in the following config:

grails.resources.mappers.baseurl.modules = [
    core: "http://default.prefix.for.links.com",
    'google-stuff': "http://somewhere.at.google.com"
]

This lets you define the base url to apply to links on a per-module basis. Any resource that is not in one of the modules you configure here will use the default url shown previously.