aboutsummaryrefslogtreecommitdiff
path: root/src/Cana.hs
AgeCommit message (Collapse)Author
2021-07-08Add basic support for virtual hostsDaniel Schadt
We can technically do vhosts with our current infrastructure of route matching, but they should get some better support. Otherwise, we cannot use things like SNI (server name indication) to send different credentials depending on the virtual host. The way it works now is basically that the server keeps a list of installed vhosts, each with a domain that it matches and a loaded certificate. Route matching in a vhost is still done the same old way, but only routes for the matching vhost are considered in the first place. The API for runGeminiServer does not change, so the proper, vhost-using API, will need a different function and API.
2021-06-30Give a reply to the server if a route failsDaniel Schadt
Otherwise, the server will never get a reply and instead we'll just silently let the client timeout :-( This change introduces the function "uncatch", which makes an error the inner Cana computation explicit by returning the Either directly. With the way this is written currently, we could probably get away with using "catch" as well, along the lines of r geminiRequest `catch` (const $ writeResponse context ...)
2021-06-28Initial commitDaniel Schadt
This is a working version that can serve pages, yay! A lot of features still missing though, as well as proper package metadata.