lpfcpServer()
As shown in Start the Server, there is a built-in function to create a Ktor server very simply:
fun main() {
// Creating a calculator object like always
val calculator = CalculatorImpl()
// Starting LPFCP Server, which exposes all annotated calculator functions
lpfcpServer(processor = calculator, port = 8080)
.start(wait = true)
}public static void main(String[] args) {
// Creating a calculator object like always
Calculator calculator = new CalculatorImpl();
// Starting LPFCP Server, which exposes all annotated calculator functions
Ktor.INSTANCE.lpfcpServer(calculator, 8080)
.start(true);
}Last updated