-
Create a dotnet core console project using this CLI command:
dotnet new console -lang F#
-
Install paket to the project.
a. If you haven't already, install the Ionide-Paket extension for VS Code.
b. Create the .paket folder using the File: New Folder command in the VS Code Command Palette.
c. Download the latest paket.bootstrapper.exe file from https://github.com/fsprojects/Paket/releases/latest into the .paket folder.
d. Finish the paket install using the Paket: Init command.
e. Add this line at the top of the paket.dependencies file:
storage: none
f. Make sure you have a .gitignore file in the project root folder that includes this:# Paket dependency manager .paket/paket.exe paket-files/
-
Install suave using the Paket: Add NuGet Package (to current project) command.
-
Add code to the Program.fs file as described in the https://suave.io/ section titled "The simplest possible application: Hello World!".
a. Addopen Suave
b. Add to the main function:startWebServer defaultConfig (Successful.OK "Hello World!")
-
Start the web server using this CLI command:
dotnet run -c Release
You should see this output:
[11:38:29 INF] Smooth! Suave listener started in 86.523 with binding 127.0.0.1:8080
-
Navigate to http://localhost:8080/ in a browser to see the web app running.
-
Press Ctrl+c in the CLI to stop the web server.
https://fsprojects.github.io/Paket/installation.html
https://www.hanselman.com/blog/LearningAboutTheFSAFEStackSuaveioAzureFableElmish.aspx