Open worldsayshi opened 5 years ago
I also had same issue, the given example does not works but gives same type error, perhaps it will be better if @parsonsmatt could modify the example so that future readers could avoid wastage of precious time figuring out what went wrong :)
For some reason
server :<|> (waiProxyTo forwardRequest defaultOnExc manager)
doesn't compile for me.You explicitly mention that "[...] while waiProxyTo ... has the type Application. If we have Servant server types (like "cat" :> Get '[JSON] Cat), then we need to have a Server for them. For the Raw endpoint, we just need any WAI application.". But you don't point it out as a problem at the time. So I assume something has changed about
:<|>
in later versions of Servant to not make it possible to combine Server and Application like that.The error looks like this:
I found a solution that looks like this:
I mimicked how
serveDirectoryWith
works. But I don't really know why this works.More info here: https://stackoverflow.com/a/57842558/439034