The application object can be accessed via $app or the app function. A default configuration filename in the application home directory will be generated from the value of "moniker" in Mojolicious ($moniker.json). You can extend the normal configuration file $moniker.json with mode specific ones like $moniker.$mode.json, which will be detected automatically.

The code of this plugin is a good example for learning to build new plugins, you're welcome to fork it.