Start the Server
Now we are ready to start the LPFCP server!
You just need to create an object of the created in previous section Class and expose it using LPFCP Java library:
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);
}Now our calculator app is exposed to the network!
Last updated