Created
August 12, 2019 09:04
-
-
Save lankydan/58503f1a8be2d0548e2f3afc6c6f7ae0 to your computer and use it in GitHub Desktop.
Corda + Ktor - server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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