Slide 13
Slide 13 text
fun main() {
Bootstrap().start(AlpacaCreator)
}
object AlpacaCreator : ApplicationCreator {
override fun invoke(bootstrap: Bootstrap): Application {
val monitor = LoggingMonitor(bootstrap.logging)
val eventStore = PgEventStore(
DatabaseTransactor(bootstrap.configuration),
monitor
)
val sparkPostClient = SparkPostClient(
bootstrap.createHttp4kClient(SparkPost),
bootstrap.configuration[OperationalKeys.SPARKPOST_SECURITY_TOKEN]
)
val emailNotifier = EmailNotifier(
sparkPostClient,
monitor
)
val appHandler = Alpaca(
CommandHandler(eventStore, emailNotifier),
DashboardProjection(eventStore))
)
return Application( bootstrap.createHttp4kServer(appHandler))
}
From Adapters
From Domain