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
6
votes
1 answer

Suave.io: using pathScan and request together

I'm just getting up and running with Suave.io. I'm sure this will become clearer as I dig more into Applicatives - but from a high level I can't see how to write a pathScan rule that applies the request applicative too. All examples I'm found only…
philsquared
  • 22,403
  • 12
  • 69
  • 98
5
votes
1 answer

Suave with f# - How to have a rest api and websocket port in an f# chat application?

I have an f# chat application that needs rest apis exposed as well as have websockets for real time messaging. I am using Suave framework. I have a frontend which has a "Chat" button that runs javascript on click. The javascript triggers the creates…
tiny m
  • 123
  • 2
5
votes
1 answer

How to get SignalR working with Suave?

Does anyone have an example of how to get SignalR working in Suave? I've created a demo project showing a working Suave server, and working hub proxy generation, along with with a demo page. The page shows a failed initialization and repeated…
5
votes
1 answer

Suave - Control when responses are 'cached' or recalculated

I want to understand how to control when responses are 'cached' versus when they are 'recalculated'. As an example: [] let main [| port |] = let config = { defaultConfig with bindings = [ HttpBinding.mk HTTP…
Stewart_R
  • 13,764
  • 11
  • 60
  • 106
5
votes
2 answers

What kind of type is this?

I just started working through Tamizhvendan S' book F# Applied and came across this code snippet: type WebPart = Context -> Async I've been looking through Microsoft's F# docs as well as my favorite F# site, Scott Wlaschin's F# for…
Kurt Mueller
  • 3,173
  • 2
  • 29
  • 50
5
votes
1 answer

Mounting Suave in an Owin application

I have an existing owin application written in C# and would like to mount a suave application as a middleware but since I am relatively new to F# I am finding it quite difficult to navigate how this should be done. I think I'm looking for something…
jonnii
  • 28,019
  • 8
  • 80
  • 108
5
votes
2 answers

How route /store/category/%s/brand/%s in F# Suave?

I can't figure how setup the router for a path like: /store/category/%s/brand/%s I have the web store demo and it work for simple URLs, but I don't see how make more flexible configurations. This is what I have: type StrPath = PrintfFormat<(string…
mamcx
  • 15,916
  • 26
  • 101
  • 189
5
votes
1 answer

Suave App Hosted on IIS with HttpPlatformHandler Closes Connection

I'm trying to get a basic Suave application running in IIS (IIS 10.0) using HttpPlatformHandler (version 1.2). When I have it return a single WebPart such as (OK "Hello World") The application runs in IIS fine and I can make requests to it by name…
Jeremy
  • 53
  • 1
  • 7
5
votes
1 answer

Sample Suave.IO does not compile in my F# project

I'm trying to get this example from Suave.io compiling for a simple F# project: http://suave.io/ open Suave.Http.Applicatives open Suave.Http.Successful open Suave.Web open Suave.Types open Suave.Model let greetings q = defaultArg (q ^^ "name")…
Andy B
  • 541
  • 2
  • 13
4
votes
1 answer

Removing key from session state

(Noting that my total experience with Suave and back-end web-development in general can be measured in days and counted on one hand) As part of my project, whenever a user successfully signs in a unique GUID is created and stored within the session…
RMills330
  • 319
  • 1
  • 12
4
votes
1 answer

WebPart for forwarding requests to another server using Suave?

I would like to create a WebPart that forwards all requests to another web server that I specify. Usage might look like this: let app = choose [ path "/" >=> OK "Hello, world. " path "/graphql" >=> createProxy "localhost:5000" …
sdgfsdh
  • 33,689
  • 26
  • 132
  • 245
4
votes
1 answer

How to handle "OPTIONS" requests in suave

I'm porting a prototype app I did using elm and python flask to use elm and a suave backend. The elm app is calling an API to load info from the site and do some other things. There does not seem to be an issue with get requests, but I'm getting…
onemorecupofcoffee
  • 2,237
  • 1
  • 15
  • 21
4
votes
1 answer

client is waiting forever for remote server to return a webpage

I have an application with a server written in F# and serve web files using suave. I remote login using powershell into another machine in the network to run the application (The application is also in one of the network drives). I do that because…
Kafo
  • 3,568
  • 1
  • 12
  • 19
4
votes
0 answers

Having problems with Azure AD, Angular 2 and preflight is invalid (redirect)

Right now I am not having a great time integrating Angular 2 and Azure AD. Steps to reproduce error: I have created an Angular 2 front end, Web API(suave.io) and it deployed Azure I have setup Azure AD on the Web Site and Web API Followed this…
Stuart
  • 91
  • 2
4
votes
1 answer

Map json input but not output in Suave

Suave.Json.mapJson maps the input JSON to an object into your function, then maps the output of your function into JSON. The problem is that I'm happy with the way it maps into my function, but I need to return a json string response rather than…
Kurren
  • 827
  • 1
  • 9
  • 18