Clone the repo!
dotNET 7 (you can downgrade dotnet version to 6.0 easily in the fsproj files)
Editor capable of working with F#, I personally recommend:
Other options:
The reason for using Feliz.ViewEngine is that I heavily use it in frontend application and if I were to write SSR I would prefer to use it for consistency. As this is a template I use myself, this is what I wanted here. Feel free to remove it. Similar stuff written in Falco.Markup have looked like this:
let indexView =
Elem.html [] [
Elem.head [] [ Elem.title [] [ Text.raw "Falco Sample" ]]
Elem.body [] [
Elem.h1 [] [ Text.raw "I |> F#" ]
Elem.p [Attr.class' "some-css-class"; Attr.id "someId"] [ Text.raw "Hello World"]
]
]
let defaultPage = Response.ofHtml indexView
Take a look at similar:
- api -
cd api && dotnet run
- tests -
cd tests && dotnet test
Just remove the tests
folder!
Comparison with Saturn & Giraffe templates I already made This template is meant a nice fresh start, without much complication
- http://localhost:5000/add/2/3 => 5
- http://localhost:5000/mul/2/3 => 6
- http://localhost:5000/json => {"language":"F#","message":"Hello World"}
- http://localhost:5000/anyRoute => htmled I |> F# Hello World