Update Jan 1, 2019
I spent some time splitting the projects and updating to ASP.NET Core 3.0 alpha (preview targets netcoreapp3.0 only). The Endpoint Routing feature is really, really nice. You can see the updated version here (diff).
Original Post
While evaluating the state of F# web frameworks over the holidays, I managed to create yet another lightweight framework prototype. You’re welcome. The prototype is based on ASP.NET Core Routing and some posts by Filip Wojcieszyn, specifically Building microservices with ASP.NET Core (without MVC) and Running ASP.NET Core content negotiation by hand. The prototype currently consists of a ContentNegotiation module and a Builder module containing a RouterBuilder and a ResourceBuilder, where the two builder types are computation expressions using CustomOperationAttributes.
let helloName =
resource app.ApplicationServices "hello/{name}" {
name "Hello Name"
get (fun ctx ->
let name = ctx.GetRouteValue("name") |> string
ctx.Response.WriteAsync(sprintf "Hi, %s!" name))
put (fun ctx ->
let name = ctx.GetRouteValue("name") |> string
ContentNegotiation.negotiate 201 name ctx)
}
Continue reading 