This library implements a basic Play Global object and related functionality for frontend applications.
Simply create an object extending DefaultFrontendGlobal. That will provide you with the common filters and error handling.
You can also override frontendFilters attribute if you need to alter the default set of filters.
Note: the play SecurityHeadersFilter is not provided by default. To enable it add 'security.headers.filter.enabled=true' in your application's configuration file (application.conf)
This library provides a default configuration for your Play frontend applications. Use it in your application's configuration file (application.conf):
include "common.conf"To enable the Metrics plugin in your application, add this line to your play.plugins file:
1:com.kenshoo.play.metrics.MetricsPluginYou can also enable the plugin's admin servlet by adding this line to your routes file:
GET /admin/metrics com.kenshoo.play.metrics.MetricsController.metricsBy default Graphite publishing is disabled. To enable if for your application, add a block like this to your application conf file:
microservice {
metrics {
graphite {
host = graphite
port = 2003
prefix = play.tax.
enabled = true
}
}
}and point your Global object (inherited from DefaultFrontendGlobal ) to it
override def microserviceMetricsConfig(implicit app: Application): Option[Configuration] = app.configuration.getConfig("microservice.metrics")Add the following to your SBT build:
resolvers += Resolver.bintrayRepo("hmrc", "releases")
libraryDependencies += "uk.gov.hmrc" % "frontend-bootstrap" % "[INSERT-VERSION]"This code is open source software licensed under the Apache 2.0 License.