scriptcs / scriptcs

Write C# apps with a text editor, nuget and the power of Roslyn!
http://scriptcs.net
Other
2.47k stars 370 forks source link

Create an ASP.NET Web API hosting layer #341

Closed glennblock closed 10 years ago

glennblock commented 11 years ago

This will leverage work done in #315

adamralph commented 11 years ago

What I'd really like to see is an OWIN hosting layer, into which each framework could be plugged in easily.

glennblock commented 11 years ago

What you are asking for is orthagonal. Each framework has it's own extensibility points and artifacts which need to be wired up via script.

For example the web API host wires in to register script based controllers. It uses specific logic to take a script of loose functions (no class required) and turn it into a web API controller.

I would image one could take the same approach for Nancy, service stack etc.

You could have a layer for turning script into OWIN middleware, but that is at a different level then what I am doing here.

This approach works with self host or IIS, so it is completely compatible with OWIN.

Having an OWIN script host is doable, but different. It would be valuable though and could use the new generic hosting layer.

-----Original Message----- From: "Adam Ralph" notifications@github.com Sent: ‎7/‎6/‎2013 4:27 PM To: "scriptcs/scriptcs" scriptcs@noreply.github.com Cc: "Glenn Block" glenn.block@gmail.com Subject: Re: [scriptcs] Create an ASP.NET Web API hosting layer (#341)

What I'd really like to see is an OWIN hosting layer, into which each framework could be plugged in easily. — Reply to this email directly or view it on GitHub.

glennblock commented 11 years ago

One thing I think I can do is move the generic logic I've added a special preprocessor that handles converting functions into classes. That can be refactored into the hosting layer where others can use it.

-----Original Message----- From: "Glenn Block" glenn.block@gmail.com Sent: ‎7/‎6/‎2013 8:30 PM To: "scriptcs/scriptcs" reply@reply.github.com; "scriptcs/scriptcs" scriptcs@noreply.github.com Subject: RE: [scriptcs] Create an ASP.NET Web API hosting layer (#341)

What you are asking for is orthagonal. Each framework has it's own extensibility points and artifacts which need to be wired up via script.

For example the web API host wires in to register script based controllers. It uses specific logic to take a script of loose functions (no class required) and turn it into a web API controller.

I would image one could take the same approach for Nancy, service stack etc.

You could have a layer for turning script into OWIN middleware, but that is at a different level then what I am doing here.

This approach works with self host or IIS, so it is completely compatible with OWIN.

Having an OWIN script host is doable, but different. It would be valuable though and could use the new generic hosting layer.

-----Original Message----- From: "Adam Ralph" notifications@github.com Sent: ‎7/‎6/‎2013 4:27 PM To: "scriptcs/scriptcs" scriptcs@noreply.github.com Cc: "Glenn Block" glenn.block@gmail.com Subject: Re: [scriptcs] Create an ASP.NET Web API hosting layer (#341)

What I'd really like to see is an OWIN hosting layer, into which each framework could be plugged in easily. — Reply to this email directly or view it on GitHub.

adamralph commented 10 years ago

Is this still a P1? It's quite old.

adamralph commented 10 years ago

Lowering to P2.

glennblock commented 10 years ago

I created something, but we should probably just close this. The work @filipw was doing with Helios is much more interesting imo.

On Tue, Jun 17, 2014 at 11:52 PM, Adam Ralph notifications@github.com wrote:

Lowering to P2.

— Reply to this email directly or view it on GitHub https://github.com/scriptcs/scriptcs/issues/341#issuecomment-46401734.