giraffe-fsharp / Giraffe

A native functional ASP.NET Core web framework for F# developers.
https://giraffe.wiki
Apache License 2.0
2.12k stars 266 forks source link

SAFE Says Can Do Standalone? #397

Closed johnaweiss closed 4 years ago

johnaweiss commented 4 years ago

The SAFE page says

it is entirely possible to write applications solely in Giraffe.

But your page says

It is not designed to ...be run standalone like NancyFx or Suave, but rather a lean micro framework which aims to complement ASP.NET Core

This sounds contradictory. Amiright?

thx!

Banashek commented 4 years ago

The idea is that you can write a full-fledged web application in Giraffe, without using a frontend framework like Fable-Elmish, react, etc, by using traditional server-side rendered templates with the giraffe view engine, razor templates, etc.

dustinmoris commented 4 years ago

@johnaweiss Kesterl is the web server, on top of Kestrel is the web application layer called ASP.NET Core and on top of ASP.NET Core there is Giraffe to make it more functional.

On the other hand frameworks like NancyFx or Suave don't need ASP.NET Core or Kestrel. They implement a web server and all layers above it themselves. This is why the Giraffe docs mentios that Giraffe itself isn't a web server or anything which can be run standalone. It's a functional web library on top of ASP.NET Core if that makes sense.

SAFE is trying to prescribe you how to write Giraffe web applications but I guess they tried to make a point that you don't have to follow these prescriptions. I haven't worked with SAFE yet tbh, but SAFE sort of comes with everything and you have to remove what you don't need and Giraffe comes as a minimal library where you add what you need.

Hope that helps!

forki commented 4 years ago

Yes safe is pretty much just one (good working) way to use giraffe. It's especially handy when your client can also use F#