I am trying to compose multiple Endpoint together when starting the http server. Multiple Endpoints are defined like this:
val foo = get("foo") { Ok("bar") }
val test = get("test") { Ok("test") }
This code is working
foo :+: test
However, this code doesnt work.
List(foo, test).reduceLeft(_ :+: _)
The error is
type mismatch;
found : io.finch.Endpoint[shapeless.:+:[String,shapeless.:+:[String,shapeless.CNil]]]
required: io.finch.Endpoint[String]
val controllers = List(foo, test).reduce(_ :+: _)
^
I dont quite understand why reduce
wont work here and what is the best practice to combine Endpoint in Finch