pheymann / typedapi

Build your web API on the type level.
MIT License
161 stars 10 forks source link

Added matching header to server-side #30

Closed pheymann closed 6 years ago

pheymann commented 6 years ago

As proposed in #28 I added a new header type for the server-side which extracts headers based on some common key string pattern:

val Api = := :> Server.Match[String]("Control-") :> Get[Json, User]

val endpoint = derive[IO](Api).from { headers => ??? ) // headers is of type Set[String]

All header keys which contain the pattern are extracted.