On Jan 24, 11:52 pm, Benjamin van der Veen <
b...@bvanderveen.com>
wrote:
I can see why you would want to use Gate.Owin for the delegates just
to keep the code readable, but to me it feels like the loss in
flexibility isn't worth it. An alternative is to use using clauses to
assign aliases to the OWIN funcs/actions whenever you need to declare
them.
The idea is that, at application boundaries, only the built-in funcs/
actions are used in method signatures.
This allows non-Gate apps to use the Owin standard and be hosted on
Kayak with minimal effort and with no extra dependencies.
If Gate itself adhered to the Owin spec, there would be no problem to
host Gate itself on Kayak, just as you would host a normal Owin app,
by passing in the app delegate (or Action).
I created a gist in case you want to have a look:
https://gist.github.com/1673393
The important file to look at is OwinHttpRequestDelegate.cs, which I
adapted from the Gate project.
In Program.cs you can see that I'm passing Nancy's OWIN method to the
server directly and it is working.
This is based on Draft 5 of the OWIN spec.
The idea is that Gate (and all other Owin apps) should follow a
similar process if they want to be hosted on Kayak.
In this solution Gate would be reduced to a Middleware framework only,
which I feel is a step in the right direction.
Web framework developers can then decide whether they want to support
Gate or not, but they really should support OWIN directly (as Nancy
does).
Gate should allow any OWIN-compliant app to be added as middleware, as
a workaround for frameworks that don't support Gate directly.
This is just my 2c as an outsider getting into the projects right now.
Let me know what you think.
Regards
--
Kevin Thiart
@kevinthiart