Skip to content

Commit

Permalink
Merge pull request #42 from spand/pr/jettyfactorymethod
Browse files Browse the repository at this point in the history
Inject factory method for the jetty Server object.
  • Loading branch information
cy6erGn0m committed Sep 14, 2016
2 parents 011e86a + fe82da3 commit 5bbb2fa
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ import javax.servlet.http.*
*/
class JettyApplicationHost(override val hostConfig: ApplicationHostConfig,
val environment: ApplicationEnvironment,
val applicationLifecycle: ApplicationLifecycle) : ApplicationHost, ApplicationHostStartable {
val applicationLifecycle: ApplicationLifecycle,
jettyServer: () -> Server = ::Server) : ApplicationHost, ApplicationHostStartable {

private val application: Application get() = applicationLifecycle.application

constructor(hostConfig: ApplicationHostConfig, environment: ApplicationEnvironment)
: this(hostConfig, environment, ApplicationLoader(environment, hostConfig.autoreload))

private val server = Server().apply {
private val server = jettyServer().apply {
connectors = hostConfig.connectors.map { ktorConnector ->
val httpConfig = HttpConfiguration().apply {
sendServerVersion = false
Expand Down

0 comments on commit 5bbb2fa

Please sign in to comment.