Questions tagged [suave]

A lightweight, non-blocking web server for F#

Suave is a lightweight, non-blocking web server. The non-blocking I/O model is efficient and suitable for building fast, scalable network applications. In fact, Suave is written in a completely non-blocking fashion throughout. Suave runs on Linux, OS X and Windows flawlessly.

112 questions
20
votes
3 answers

F# Suave warbler function

I've started learning F# and Suave and I'm reading the book F# Applied. One thing I'm struggling with is the warbler function. I know its something to do with deferring execution but I don't really understand why and when its needed. Apparently we…
Simon Lomax
  • 8,714
  • 8
  • 42
  • 75
15
votes
1 answer

Run self-hosted OWIN application in Azure Web Apps

It is possible to run a suave.io app on Azure Web Apps because of an IIS8 feature called HttpPlatformHandler. I tried to run a self-hosted OWIN application the same way, but got an exception on startup: Unhandled Exception:…
Johannes Egger
  • 3,874
  • 27
  • 36
12
votes
1 answer

Websockets in Suave

I've been looking into using websockets with the Suave web server. Unfortunately, it's not very well documented, and all I've managed to find was this: https://github.com/SuaveIO/suave/tree/master/examples/WebSocket However, that only shows the…
kaeedo
  • 458
  • 2
  • 13
10
votes
1 answer

Routes with optional parameters in Suave

I have a web service with a hello world endpoint like this: let app = choose [ GET >=> choose [ path "/hello" >=> OK "Hello World!" pathScan "/hello/%s" (fun name -> OK (sprintf "Hello World from %s" name)) ] …
dustinmoris
  • 3,195
  • 3
  • 25
  • 33
10
votes
1 answer

Suave serve static files

I'll like to serve all files in my 'public' folder with suave Inside my public I have: /index.html /styles/main.css /scripts/app.js /images/*.(png|jpg) Do I use a homeFolder? Or how does this work? Does the public folder need to be copied next to…
user1613512
  • 3,590
  • 8
  • 28
  • 32
9
votes
2 answers

How to implement server-push over websocket in suave?

can I write something like this let echo (ws: WebSocket) = fun ctx -> socket { let loop = ref true while !loop do let! message = Async.Choose (ws.read()) (inbox.Receive()) match message with …
Viet NT
  • 305
  • 2
  • 9
8
votes
1 answer

Suave in watch mode (during development)

I am working on Suave 1.0 + Angular 2.0 sample app and very interesting to start Suave server in watch mode, so the server watch file changes (js,css,html) in root folder and sub-folders and automatically send refresh command to all open browser…
Sergey Tihon
  • 12,071
  • 4
  • 23
  • 29
7
votes
1 answer

Is SUAVE production ready for web application development with millions of user traffic?

We are a startup and currently in the evaluation mode for using SUAVE with F# as the web application development framework. I am very enthusiastic for using the SUAVE framework for developing my applications. I just want to know if SUAVE is…
Rajat Agrawal
  • 357
  • 1
  • 2
  • 9
7
votes
1 answer

Unable to return a JSON with Suave F#

I'm following the suave tutorial and I'm struggling to return a JSON to the front end. I currently have the code. (I'm not using the Chiron package). I can start the web server just fine but when I go to localhost:8083/hello I get the error message…
Luke Xu
  • 2,302
  • 3
  • 19
  • 43
7
votes
3 answers

Is there a way to pipe an image directly to a suave response stream?

I want to dynamically generate an image on server side and send it to the browser. Currently I'm using a MemoryStream to convert it to byte array and then usual suave api. See bellow: let draw (text:string) = let redBr = new…
Adrian
  • 1,006
  • 2
  • 9
  • 20
6
votes
2 answers

Allow multiple headers with CORS in Suave

I'm trying to get my Suave API to accept CORS requests. I've followed this snippet here: http://www.fssnip.net/mL/title/CORS-response-with-Suave Which I will recreate here: let setCORSHeaders = setHeader "Access-Control-Allow-Origin" "*" …
Max
  • 849
  • 9
  • 24
6
votes
0 answers

Cookie authentication in websharper + suave + OWIN

As part of an evaluation process for a commercial project I'm searching for any full fledged example of authentication/authorization using the websharper stack. I'd like to use OWIN, since it seems to be a well designed protocol, but I'm open to…
YuriAlbuquerque
  • 2,178
  • 1
  • 11
  • 19
6
votes
0 answers

Azure: Suave fails sometimes with HttpPlatfomHandler and doesn't come back up

I'm hosting my web application on azure web app by using suave and following the recommended guide. My app was running like a charm until some days ago something went horribly wrong: The process threw and exception and crashed, but…
Tobias Burger
  • 93
  • 1
  • 4
6
votes
1 answer

What is the simplest way to check that an incoming request contains a certain header value

I have a simple Suave.io server in the form: let Ok o = o |> JsonConvert.SerializeObject |> Successful.OK let NotOk o = o |> JsonConvert.SerializeObject |> RequestErrors.BAD_REQUEST type Result<'T> = | Success of 'T | Failure of string let DoThing…
Kit
  • 2,089
  • 1
  • 11
  • 23
6
votes
2 answers

Reload Suave App on File Save

I've recently started with Suave; I setup a project using yeoman and the F# generator. To run the app, I build an executable using Fake and then run it. Whenever I change any of the app files, i.e. *.fs files, I have to repeat the process of…
Ari
  • 4,121
  • 8
  • 40
  • 56
1
2 3 4 5 6 7 8