package yurt
An HTTP framework for OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
v0.3.tar.gz
sha256=e2bdc7cc0aa1decefb16c9a11b4ac60bce8f97010750c8b8c5c8630dc2f98dab
md5=8f6ab0c5880c8280e330ab7f12c37266
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: 26 Jul 2017
README
Yurt
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.
Dependencies (7)
-
ezjsonm
>= "0.5.0"
-
cohttp-lwt-unix
>= "0.99.0" & < "1.0"
-
conduit-lwt-unix
>= "1.0.0"
-
topkg
build
-
ocamlbuild
build
-
ocamlfind
build
-
ocaml
>= "4.03.0"
Dev Dependencies
None
Used by
None
Conflicts
None
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page