Current release information
The current version has a dependency on Suave 2.0.0-rc3, which is not considered a stable release yet. At the moment Suave.AspNetCore also only supports Suave's web request handling and support for web sockets will follow soon.
|.NET Standard||>= 1.6||Suave 2.0.0-* requires netstandard1.6 or higher.|
|Full .NET||>= 4.6||Microsoft.AspNetCore.Http and Microsoft.AspNetCore.WebSockets.Server requires .NET 4.6 or higher.|
Install NuGet package
PM> Install-Package Suave.AspNetCore
Create a Suave web app
open Suave open Suave.Operators open Suave.Successful module App = let helloWorld = fun (ctx : HttpContext) -> OK "Hello World from Suave" ctx
Add Suave middleware to ASP.NET Core
type Startup() = member __.Configure (app : IApplicationBuilder) (env : IHostingEnvironment) (loggerFactory : ILoggerFactory) = app.UseSuave(App.helloWorld) |> ignore
HTTP header casing
In Suave all HTTP headers are stored in lower case inside the
Suave.Http.HttpRequest object, but ASP.NET Core preserves the original casing by default.
For example if a client sends the HTTP header
Content-Type: application/json with the request, then it would be stored as such in ASP.NET Core, but in lower case in Suave:
When configuring the Suave middleware you can set the
preserveHttpHeaderCasing parameter to
true to keep the original casing present (ASP.NET Core style):
By default this setting is disabled to match existing Suave applications.
Error handling and other Suave config settings
Suave.AspNetCore allows you to hook a Suave web application (
WebPart) into the ASP.NET Core pipeline. Anything that was configured in the
SuaveConfig was web server specific and required to run Suave's own web server via
startWebServer. In ASP.NET Core there are other means to configure the same settings. For more information please check out the ASP.NET Core Fundamentals.
How to build
After forking the project you should be able to run the default .NET CLI commands to build and publish the NuGet package:
dotnet restore dotnet build dotnet pack
Massive thank you to ademar and haf for creating (and open sourcing) Suave in the first place and also a big thanks to Krzysztof Cieslak for open sourcing a super early alpha version of Suave.Kestrel which was as a great kickstarter to get Suave.AspNetCore running.
Feedback is more than welcome and pull requests get accepted!