Skip to content

Instantly share code, notes, and snippets.

@CarstenKoenig
Last active November 22, 2016 23:19
Show Gist options
  • Save CarstenKoenig/904d460ea30685f53456a5398ff65533 to your computer and use it in GitHub Desktop.
Save CarstenKoenig/904d460ea30685f53456a5398ff65533 to your computer and use it in GitHub Desktop.

Run Suave on Linux

Step 1 - Install Forge

  • clone the forge-project git clone https://github.com/fsharp-editing/Forge.git
  • change directory cd Forge
  • run the build script ./build.sh

if all works out you should have a Forge.exe in ./temp/bin that you can call with mono (assuming you use mono)

I use a simple script (just forge) like this:

#!/usr/bin/env bash

mono ~/coding/tools/Forge/temp/bin/Forge.exe "$@"

Put this file into a directory in your path (in my case I have a ~/bin) and mark it as executable with chmod +x forge

From then on you can just use forge to call the executable from anywhere.

To see if it works try

forge list templates

and you should get a list including

...
servicefabricsuavestateless
suave
suaveazurebootstrapper
temp
...

Step 2 - forging a Suave project

now you can create a new project.

Navigate to a target folder and initialize a new project with

forge new project --name SuaveTest --dir SuaveTest --template suave

(note this will start putting files right into the current folder so maybe you'll want to mkdir and cd into some other place first)

you should now find a build.sh right where you started the command. chmod +x this script too, so you can run it directly.

Next build the project with ./build.sh and you should end up with having a ./build/SuaveTest.exe

Step 3 - testing it

just run mono ./build/SuaveTest.exe which should start the server on localhost:8083 if you now navigate to this address using a browser you should see a

Hello World!

from suave

Step 4 - adapt to your liking ...

...


How to deal with certificate errors

If during any step downloads fail it might be caused by missing root-certificates.

In this case just try this:

mozroots --import --sync

This command will downlad and install trusted root certificates from Mozillas LXR into Monos store (see the Linux man page on mozroots)

If this does not help you can try to install them on the machine-level:

sudo mozroots --import --machine --sync
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment