yurt

An HTTP microframework for OCaml
README

yurt is an HTTP framework for OCaml based on Cohttp.

Features

  • Simple API

  • Multipart forms

  • Regex based URL routing

Installation

opam install yurt

Usage

open Yurt.Server
open Yurt.Route

(* Create a server *)
server "127.0.0.1" 1234

(* Add a handler *)
>| get "/<name:string>" (fun req params body ->
    let greeting = "Hello " ^ param_string "name" in
    respond_string ~status:`OK ~body:greeting ())

(* Run it *)
|> run

See example/example.ml for more examples.

Install
Published
14 Jun 2017
Sources
v0.1.tar.gz
md5=b4c14b2aedd4ff34b4dca31884628666
Dependencies
ezjsonm
>= "0.5.0"
cohttp
>= "0.22.0" & < "0.99"
conduit
>= "0.15.0"
lwt
>= "2.7.0"
topkg
build
ocaml
>= "4.03.0" & < "4.06.0"
Reverse Dependencies