package yurt

  1. Overview
  2. Docs
An HTTP microframework for OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

v0.1.tar.gz
sha256=327f7c3a917cea3669fcd09ac0ba020e540f443fd8d76176548df9dd12fd5883
md5=b4c14b2aedd4ff34b4dca31884628666

Description

Yurt provides a simple API for creating HTTP servers based on Cohttp and Lwt. See https://github.com/zshipko/yurt for more information.

Published: 14 Jun 2017

README

Yurt

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.

Dependencies (8)

  1. ezjsonm >= "0.5.0"
  2. cohttp >= "0.22.0" & < "0.99"
  3. conduit >= "0.15.0"
  4. lwt >= "2.7.0"
  5. topkg build
  6. ocamlbuild build
  7. ocamlfind build
  8. ocaml >= "4.03.0" & < "4.06.0"

Dev Dependencies

None

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.