All Projects → SuaveIO → Suave

SuaveIO / Suave

Licence: other
Suave is a simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition.

Programming Languages

fsharp
127 projects

Projects that are alternatives of or similar to Suave

Igropyr
a async http server base on libuv for Chez Scheme
Stars: ✭ 85 (-92.89%)
Mutual labels:  async, http-server, webserver
Cowboy
Small, fast, modern HTTP server for Erlang/OTP.
Stars: ✭ 6,533 (+446.24%)
Mutual labels:  functional, http-server
Iodine
iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
Stars: ✭ 720 (-39.8%)
Mutual labels:  http-server, webserver
Farwest
Framework for building RESTful HATEOAS-driven applications.
Stars: ✭ 18 (-98.49%)
Mutual labels:  functional, http-server
Hydra
后端一站式微服务框架,提供API、web、websocket,RPC、任务调度、消息消费服务器
Stars: ✭ 407 (-65.97%)
Mutual labels:  http-server, webserver
Async Reactor
Render async Stateless Functional Components in React
Stars: ✭ 452 (-62.21%)
Mutual labels:  async, functional
Beetlex
high performance dotnet core socket tcp communication components, support TLS, HTTP, HTTPS, WebSocket, RPC, Redis protocols, custom protocols and 1M connections problem solution
Stars: ✭ 802 (-32.94%)
Mutual labels:  http-server, webserver
Picoweb
Really minimal web application framework for the Pycopy project (minimalist Python dialect) and its "uasyncio" async framework
Stars: ✭ 361 (-69.82%)
Mutual labels:  async, webserver
Webcpp
用C++开发web服务器框架
Stars: ✭ 23 (-98.08%)
Mutual labels:  http-server, webserver
Chili
Chili: HTTP Served Hot
Stars: ✭ 7 (-99.41%)
Mutual labels:  async, http-server
Embedio
A tiny, cross-platform, module based web server for .NET
Stars: ✭ 1,007 (-15.8%)
Mutual labels:  http-server, webserver
Kotlin Flow Extensions
Extensions to the Kotlin Flow library.
Stars: ✭ 404 (-66.22%)
Mutual labels:  async, functional
Binserve
A blazingly fast static web server with routing, templating, and security in a single binary you can set up with zero code. ⚡️🦀
Stars: ✭ 401 (-66.47%)
Mutual labels:  http-server, webserver
Cppserver
Ultra fast and low latency asynchronous socket server & client C++ library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 528 (-55.85%)
Mutual labels:  async, http-server
Nodemcu Httpserver
A (very) simple web server written in Lua for the ESP8266 firmware NodeMCU.
Stars: ✭ 369 (-69.15%)
Mutual labels:  http-server, webserver
Netcoreserver
Ultra fast and low latency asynchronous socket server & client C# .NET Core library with support TCP, SSL, UDP, HTTP, HTTPS, WebSocket protocols and 10K connections problem solution
Stars: ✭ 799 (-33.19%)
Mutual labels:  async, http-server
Http Server
A non-blocking HTTP application server for PHP based on Amp.
Stars: ✭ 1,122 (-6.19%)
Mutual labels:  async, http-server
Restana
Super fast and minimalist framework for building REST micro-services.
Stars: ✭ 341 (-71.49%)
Mutual labels:  http-server, webserver
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (-70.9%)
Mutual labels:  http-server, webserver
Http static
File serving using tower web
Stars: ✭ 18 (-98.49%)
Mutual labels:  async, http-server

Introduction

Suave Logo

Suave is a simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition. Suave is inspired in the simplicity of Happstack and born out of the necessity of embedding web server capabilities in my own applications. Suave supports Websocket, HTTPS, multiple TCP/IP bindings, Basic Access Authentication, Keep-Alive.

Suave also takes advantage of F# asynchronous workflows to perform non-blocking IO. In fact, Suave is written in a completely non-blocking fashion throughout.

Build Status

Platform Status
Windows Build status
Mono/Linux Build status

What follows is a tutorial on how to create applications. Scroll past the tutorial to see detailed function documentation.

Tutorial: Hello World!

The simplest Suave application is a simple HTTP server that greets all visitors with the string "Hello World!"

open Suave

startWebServer defaultConfig (Successful.OK "Hello World!")

Now that you've discovered how to do "Hello World!", go read the rest of the documentation – editable in the docs folder.

Suave.Testing

We have a NuGet ready for your testing needs; Suave is an excellent server for running in-process integration tests, as it's very fast to spawn. On an ordinary laptop, running hundreds of randomized tests and micro-benchmarks as well as all Suave unit tests, take about 5 seconds on mono.

Start by installing:

paket add nuget suave.testing

You can now use it:

open Suave
open Suave.Testing
open Expecto

testCase "parsing a large multipart form" <| fun _ ->

  let res =
    runWithConfig (OK "hi")
    |> req HttpMethod.POST "/" (Some byteArrayContent)

  Expect.equal res "hi" "Should get the correct result"

All of our tests use this assembly; you can do too.

How to Build

To execute the build script, invoke following command on the Linux or MacOs console:

./build.sh

Or in the Microsoft Windows MSDOS console:

build

Coding Guidelines

Suave.X where X is a module is where we expect users to look. We don't expect users of the library to have to look at Y in Suave.X.Y, so for server-specific code, please stick to the Y module/namespace. That way we make the API discoverable.

Style Guide

Two space indentation.

match x with // '|' characters at base of 'match'
| A     -> ()
| Bcdef -> "aligned arrows" // space after '|' character

Parameters

Let type annotations be specified with spaces after the argument symbol and before the type.

module MyType =
  let ofString (scheme : string) =
    // ...

Method formatting with no spaces after/before normal parenthesis

let myMethodName firstArg (second : WithType) = async { // and monad builder
  return! f firstArg second
  } // at base of 'let' + 2 spaces

You need to document your methods with '///' to create XML-doc. A XML documentation file is generated together with the compilation and is distributed with the NuGet so that others can read your code's intentions easily.

Don't put unnecessary parenthesis unless it makes the code more clear.

When writing functions that take some sort of 'configuration' or that you can imagine would like to be called with a parameter which is almost always the same value for another function body's call-site, put that parameter before more-often-varying parameters in the function signature.

Building the website

Run the following in the docs directory. It requires Ruby installed.

bundle exec jekyll build

Testing

Run Tests as a console app. Return status code = 0 means success.

Upgrade openssl

Windows: paket update openssl.redist

OS X: brew install openssl && brew update openssl && cp /usr/local/Cellar/openssl/1.0.1j_1/lib/ .

Linux: ...

Community

Chat Room

We have a chat room in case you feel like chatting a bit.

Chat Room

Integrations

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].