Skip to content

Instantly share code, notes, and snippets.

@lankydan lankydan/Server.kt
Created Aug 12, 2019

Embed
What would you like to do?
Corda + Ktor - server
fun main() {
embeddedServer(
Netty,
port = System.getProperty("server.port").toInt(),
module = Application::module
).start().addShutdownHook()
}
fun Application.module() {
val connection: CordaRPCConnection = connectToNode()
install(CallLogging) { level = Level.INFO }
install(ContentNegotiation) { cordaJackson(connection.proxy) }
routing { messages(connection.proxy) }
addShutdownEvent(connection)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.