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
1
vote
2 answers

Error message in Xamarin Studio: Multiple references to FSharp.Core.dll are not permitted

When I set up a new F# project in Xamarin Studio with a reference to Suave I get an error. Here are the steps to reproduce the error message: Create a new solution in Xamarin Studio 6. Type: Console Project in F# Add the Suave nuget package: Suave…
Olaf
  • 3,786
  • 4
  • 25
  • 38
1
vote
1 answer

Embedding data in a F# (micro) service

I am trying to create a F# + Suave based micro service, that takes a request and uses a few matrices and lookup tables to calculate a response. The service has to run on in a docker container on Linux (mono later CoreCLR). These matrices and lookup…
Alexander Battisti
  • 2,178
  • 2
  • 19
  • 24
1
vote
1 answer

Why there is no bindQuery equivalent to bindForm in Suave.Forms?

I'm trying to write a web site with Suave.io and have a form which can be submitted as post or get request. I found an example how to bind form values to dto, But can't find a way how to bind query params to the same dto. let app : WebPart = …
Hodza
  • 3,118
  • 26
  • 20
1
vote
1 answer

How to get basic websharper app in xamarin loading javascript in browser

I've created the basic Websharper UI.Next client server running Suave.IO app. I'm using latest Xamarin on OSX Yosemite. I updated all the nuget packages after installing the template project and then just ran it. I've started the application and…
bradgonesurfing
  • 30,949
  • 17
  • 114
  • 217
1
vote
1 answer

Access Suave self hosted app in Azure VM from internet

I deployed a Suave selfhosted webapp that is accessible from http://localhost:9001 inside an Azure VM Windows Server 2012 R2 Datacenter and am trying to make it accessible from outside the VM on http://[my-vm-name].cloudapp.net:9001. It is a simple…
K. L.
  • 654
  • 2
  • 10
  • 21
1
vote
1 answer

strange f# list notation in suave.io

In suave.io we can use choose combinator that has the Types.WebPart list -> Types.WebPart type. Examples from their website show that I can use this combinator like this: choose [ path "/hello" >>= OK "Hello GET" path "/goodbye" >>= OK…
Grzegorz Sławecki
  • 1,727
  • 14
  • 27
0
votes
0 answers

System.Net.Sockets.SocketException (10061): No connection could be made because the target machine actively refused it

I'm writing an integration test for a component that does a transaction and after that, a webhook is called. For that, I want to mock a webhook endpoint using suave so I can know if the webhook was hit after the transaction was done. I'm doing the…
Kanagawa Marcos
  • 100
  • 1
  • 9
0
votes
1 answer

Failing to use LazyCache with Suave's WebPart

I'm trying to use LazyCache (https://github.com/alastairtree/LazyCache) to cache some API requests. The code goes as this: let private cache = CachingService() let doAPIStuff some parameters : WebPart = ... let result =…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
1 answer

not understanding the Suave API, always the same result is returned

Here is a test: open System open System.Threading open Newtonsoft.Json open Suave open Suave.Logging open Suave.Operators open Suave.Filters open Suave.Writers let private configuration = { defaultConfig with bindings = […
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
0 answers

Can I set thread priority in dotnet? (specifically interacting with Suave webserver, but it's a general question)

I have a tool that does a lot of calculations in a loop. It is creating async tasks and then run them in parallel. About 20% of the time, the CPU is maxed out. At the same time, I have a REST api, implemented with Suave, used to query the data. The…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
1 answer

how to redirect from http to https with suave, in f#

How can I redirect a connection from http to https using Suave? at https://gist.github.com/ademar/f4ddb788162dbdd9e104574e2accf07f I found this: let redirectToSsl : WebPart = context(fun c -> match c.request.header "x-forwarded-proto"…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
1 answer

default path issue with static files with Suave, in F#

I am not understanding the doc when it comes to serving static files. I have a site where the backend is deployed to /app in a docker container and the front end part is deployed to /app/frontend The main file for the front end is at:…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
0 answers

Suave runs out of sockets when receiving messages from AWS' SNS service

This is linked to question: Suave stops responding with "Socket failed to accept a client" error When I first started to use Suave, I was taking commands from a 3rd party service pushing messages and I would have an out of socket situation. There is…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
1 answer

Suave stops responding with "Socket failed to accept a client" error

I have an app running on AWS through ECS (as a Docker container) for which I used Suave to receive some REST commands. The code is very primitive: let conf = { defaultConfig with bindings = [ HttpBinding.createSimple HTTP "0.0.0.0" 80] } let…
Thomas
  • 10,933
  • 14
  • 65
  • 136
0
votes
1 answer

returning a custom error with Suave, in F#

Where can I find, in the Suave docs, the way to return an http error with a message as a plain text error? I keep looking and I just can't find my way through the docs since it's structured as bits of examples here and there. What I would like to do…
Thomas
  • 10,933
  • 14
  • 65
  • 136