yurt

An HTTP framework for OCaml
README

yurt is an HTTP microframework for OCaml based on Cohttp.

Features

  • Simple API

  • Multipart forms

  • Regex based URL routing

  • Code-based templates

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 body = Yurt_html.h1 ("Hello " ^ param_string params "name") in
    respond_html ~status:`OK ~body ())

(* Run it *)
|> run

See example/example.ml for more examples.

Install
Published
31 Jan 2018
Sources
v0.5.tar.gz
md5=8b5bab07d30fed735101a0f3a7fdfedb
Dependencies
ezjsonm
>= "0.5.0"
lwt_log
>= "1.0.0"
conduit-lwt-unix
>= "1.0.0" & < "2.3.0"
topkg
build
ocaml
>= "4.03.0"
Reverse Dependencies