Skip to content

Instantly share code, notes, and snippets.

@jagedn
Last active September 27, 2016 16:00
Show Gist options
  • Save jagedn/4e2e9dadab7c11debaced770d59d1049 to your computer and use it in GitHub Desktop.
Save jagedn/4e2e9dadab7c11debaced770d59d1049 to your computer and use it in GitHub Desktop.
Using Spring Cloud Config Server with Grails 3.1
// Don't forget to enable refresh endpoint into application.yml
# Spring Actuator Endpoints are Disabled by Default
endpoints:
enabled: false
jmx:
enabled: true
refresh:
enabled: true
class ApplicationController implements PluginManagerAware {
GrailsApplication grailsApplication
GrailsPluginManager pluginManager
@Autowired
BeansConfiguration beansConfiguration
def index() {
[grailsApplication: grailsApplication, pluginManager: pluginManager,hello:beansConfiguration.hello]
}
}
// follow http://mrhaki.blogspot.com.es/2016/01/grails-goodness-using-spring-cloud.html instructions
// after, add a BeansConfiguration:
@Component
@ConfigurationProperties(prefix="authorization")
class BeansConfiguration {
String hello
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment