Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suave Web Application running on Ubuntu

Tags:

ubuntu

suave

I'm looking for a simple 'Hello, World" example of Suave running on Ubuntu. I have tried looking all over the net to no avail

like image 665
Colin Avatar asked Dec 31 '25 09:12

Colin


1 Answers

I have managed to get it up and running on Xubuntu 16.04. I am using dotnet core and visual studio code.

To the best of my memory :) :

Install dot net core (from https://www.microsoft.com/net/core#ubuntu)

sudo sh -c 'echo "deb [arch=amd64] https://apt-mo.trafficmanager.net/repos/dotnet/ xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

sudo apt-key adv --keyserver apt-mo.trafficmanager.net --recv-keys 417A0893

sudo apt-get update

sudo apt-get install dotnet-dev-1.0.0-preview2-003121

Then install visual studio code: https://code.visualstudio.com/Docs/?dv=linux64_deb

Add ionide extension for syntax highlight etc. In VS Code Ctrl + P - ext install ionide-fsharp

Then in terminal (will create a blank Fsharp project):

mkdir hwapp

cd hwapp

dotnet new --lang f#

Then add suave to project.json file:

"dependencies": {

    "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160509",

    "Suave": "2.0.0-alpha4",

    "Microsoft.NETCore.App": {

  "type": "platform",

  "version": "1.0.0"

}

Then the standard suave helloworld should work in Program.fs

open Suave

startWebServer defaultConfig (Successful.OK "Hello World!")
like image 161
onemorecupofcoffee Avatar answered Jan 05 '26 22:01

onemorecupofcoffee



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!