| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent babbb75 commit 19be258
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,7 +25,7 @@ import play.api.routing.Router | |||
| 25 | 25 | import router.Routes | |
| 26 | 26 | import rugby.conf.RugbyLifecycle | |
| 27 | 27 | import rugby.controllers.MatchesController | |
| 28 | - import services.ConfigAgentLifecycle | ||
| 28 | + import services._ | ||
| 29 | 29 | import weather.controllers.{WeatherController, LocationsController} | |
| 30 | 30 | ||
| 31 | 31 | class AppLoader extends FrontendApplicationLoader { | |
@@ -44,7 +44,8 @@ trait Controllers | |||
| 44 | 44 | extends AdminControllers | |
| 45 | 45 | with AdminJobsControllers | |
| 46 | 46 | with ApplicationsControllers | |
| 47 | - with ArticleControllers { | ||
| 47 | + with ArticleControllers | ||
| 48 | + with DiagnosticsControllers { | ||
| 48 | 49 | self: BuiltInComponents with MostPopularComponents => | |
| 49 | 50 | lazy val accessTokenGenerator = wire[AccessTokenGenerator] | |
| 50 | 51 | lazy val apiSandbox = wire[ApiSandbox] | |
@@ -62,7 +63,6 @@ trait Controllers | |||
| 62 | 63 | lazy val ctaController = wire[CtaController] | |
| 63 | 64 | lazy val dedupedController = wire[DedupedController] | |
| 64 | 65 | lazy val devAssetsController = wire[DevAssetsController] | |
| 65 | - lazy val diagnosticsController = wire[DiagnosticsController] | ||
| 66 | 66 | lazy val emailSignupController = wire[EmailSignupController] | |
| 67 | 67 | lazy val faciaController = wire[FaciaControllerImpl] | |
| 68 | 68 | lazy val fixturesAndResultsContainerController = wire[FixturesAndResultsContainerController] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,41 @@ | |||
| 1 | + import app.{FrontendComponents, FrontendApplicationLoader} | ||
| 2 | + import com.softwaremill.macwire._ | ||
| 3 | + import common._ | ||
| 4 | + import common.Logback.LogstashLifecycle | ||
| 5 | + import conf.switches.SwitchboardLifecycle | ||
| 6 | + import conf.{CommonGzipFilter, CachedHealthCheckLifeCycle} | ||
| 7 | + import controllers.{Assets, DiagnosticsControllers, HealthCheck} | ||
| 8 | + import model.ApplicationIdentity | ||
| 9 | + import play.api.ApplicationLoader.Context | ||
| 10 | + import play.api.mvc.EssentialFilter | ||
| 11 | + import play.api.routing.Router | ||
| 12 | + import play.api._ | ||
| 13 | + import router.Routes | ||
| 14 | + | ||
| 15 | + class AppLoader extends FrontendApplicationLoader { | ||
| 16 | + override def buildComponents(context: Context): FrontendComponents = new BuiltInComponentsFromContext(context) with AppComponents | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + trait Controllers extends DiagnosticsControllers { | ||
| 20 | + self: BuiltInComponents => | ||
| 21 | + lazy val healthCheck = wire[HealthCheck] | ||
| 22 | + lazy val assets = wire[Assets] | ||
| 23 | + } | ||
| 24 | + | ||
| 25 | + trait AppLifecycleComponents { | ||
| 26 | + self: FrontendComponents with Controllers => | ||
| 27 | + | ||
| 28 | + override lazy val lifecycleComponents = List( | ||
| 29 | + wire[LogstashLifecycle], | ||
| 30 | + wire[DiagnosticsLifecycle], | ||
| 31 | + wire[SwitchboardLifecycle], | ||
| 32 | + wire[CloudWatchMetricsLifecycle], | ||
| 33 | + wire[CachedHealthCheckLifeCycle] | ||
| 34 | + ) | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + trait AppComponents extends FrontendComponents with AppLifecycleComponents with Controllers { | ||
| 38 | + lazy val router: Router = wire[Routes] | ||
| 39 | + lazy val appIdentity = ApplicationIdentity("frontend-diagnostics") | ||
| 40 | + override lazy val httpFilters: Seq[EssentialFilter] = wire[CommonGzipFilter].filters | ||
| 41 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,8 @@ | |||
| 1 | + package controllers | ||
| 2 | + | ||
| 3 | + import com.softwaremill.macwire._ | ||
| 4 | + | ||
| 5 | + trait DiagnosticsControllers { | ||
| 6 | + lazy val diagnosticsController = wire[DiagnosticsController] | ||
| 7 | + lazy val quizzesController = wire[QuizzesController] | ||
| 8 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,4 +2,4 @@ package controllers | |||
| 2 | 2 | ||
| 3 | 3 | import conf.AllGoodCachedHealthCheck | |
| 4 | 4 | ||
| 5 | - object HealthCheck extends AllGoodCachedHealthCheck(9006, "/robots.txt") | ||
| 5 | + class HealthCheck extends AllGoodCachedHealthCheck(9006, "/robots.txt") | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,7 +9,7 @@ import scala.concurrent.ExecutionContext.Implicits | |||
| 9 | 9 | import scala.concurrent.Future | |
| 10 | 10 | ||
| 11 | 11 | // Deprecated service, we won't support quiz results soon. | |
| 12 | - object QuizzesController extends Controller with Logging { | ||
| 12 | + class QuizzesController extends Controller with Logging { | ||
| 13 | 13 | ||
| 14 | 14 | implicit val ec = Implicits.global | |
| 15 | 15 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,9 +34,7 @@ play { | |||
| 34 | 34 | compressionEnabled: true | |
| 35 | 35 | } | |
| 36 | 36 | ||
| 37 | - http { | ||
| 38 | - filters: "conf.CommonGzipFilter" | ||
| 39 | - } | ||
| 37 | + application.loader = AppLoader | ||
| 40 | 38 | } | |
| 41 | 39 | ||
| 42 | 40 | guardian: { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,5 +7,5 @@ class DiagnosticsTestSuite extends Suites ( | |||
| 7 | 7 | // Add you test classes here | |
| 8 | 8 | ) with SingleServerSuite { | |
| 9 | 9 | ||
| 10 | - override lazy val port: Int = HealthCheck.testPort | ||
| 10 | + override lazy val port: Int = new HealthCheck().testPort | ||
| 11 | 11 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,7 +99,8 @@ object Frontend extends Build with Prototypes { | |||
| 99 | 99 | val diagnostics = application("diagnostics").dependsOn(commonWithTests).aggregate(common).settings( | |
| 100 | 100 | libraryDependencies ++= Seq( | |
| 101 | 101 | uaDetectorResources | |
| 102 | - ) | ||
| 102 | + ), | ||
| 103 | + RoutesKeys.routesGenerator := InjectedRoutesGenerator | ||
| 103 | 104 | ) | |
| 104 | 105 | ||
| 105 | 106 | val admin = application("admin").dependsOn(commonWithTests).aggregate(common).settings( | |
| Back | FazBrowse Home | New Git URL |
0 commit comments