in http-server/src/main/scala/com/twitter/finatra/http/servers.scala [316:362]
override protected def postWarmup(): Unit = {
super.postWarmup()
// START HTTP
for (address <- parsePort(httpPortFlag)) {
httpServer = buildHttpListeningServer(
address,
frameworkConfigureHttpServer(
configureHttpServer(defaultHttpServer(httpServerNameFlag()))
)
)
onExit {
Await.result(httpServer.close(shutdownTimeoutFlag().fromNow))
}
await(httpServer)
httpAnnounceFlag() match {
case HttpServerTrait.NoHttpAnnouncement => // no-op
case addr =>
info(s"http server announced to $addr")
httpServer.announce(addr)
}
info(s"http server started on port ${PortUtils.getPort(httpServer.boundAddress)}")
}
// START HTTPS
for (address <- parsePort(httpsPortFlag)) {
httpsServer = buildHttpsListeningServer(
address,
frameworkConfigureHttpsServer(
configureHttpsServer(defaultHttpServer(httpsServerNameFlag()))
)
)
onExit {
Await.result(httpsServer.close(shutdownTimeoutFlag().fromNow))
}
await(httpsServer)
httpsAnnounceFlag() match {
case HttpServerTrait.NoHttpAnnouncement => // no-op
case addr =>
info(s"https server announced to $addr")
httpsServer.announce(addr)
}
info(s"https server started on port ${PortUtils.getPort(httpsServer.boundAddress)}")
}
}