···
3
+
synopsis: "Tidy, feature-complete Web framework"
4
+
tags: ["http" "web" "framework" "websocket" "graphql" "server" "http2" "tls"]
7
+
Dream is a feature-complete Web framework with a simple programming
8
+
model and no boilerplate. It provides only two data types, request and
11
+
Almost everything else is either a built-in OCaml type, or an
12
+
abbreviation for a bare function. For example, a Web app, known in
13
+
Dream as a handler, is just an ordinary function from requests to
14
+
responses. And a middleware is then just a function from handlers to
17
+
Within this model, Dream adds:
19
+
- Session management with pluggable back ends.
20
+
- A fully composable router.
21
+
- Support for HTTP/1.1, HTTP/2, and HTTPS.
23
+
- GraphQL, including subscriptions and a built-in GraphiQL editor.
24
+
- SQL connection pool helpers.
25
+
- Server-side HTML templates.
26
+
- Automatic secure handling of cookies and forms.
27
+
- Unified, internationalization-friendly error handling.
28
+
- A neat log, and OCaml runtime configuration.
29
+
- Helpers for Web formats, such as Base64url, and a modern cipher.
31
+
Because of the simple programming model, everything is optional and
32
+
composable. It is trivailly possible to strip Dream down to just a
33
+
bare driver of the various HTTP protocols.
35
+
Dream is presented as a single module, whose API is documented on one
36
+
page. In addition, Dream comes with a large number of examples.
37
+
Security topics are introduced throughout, wherever they are
41
+
homepage: "https://github.com/aantron/dream"
42
+
doc: "https://aantron.github.io/dream"
43
+
bug-reports: "https://github.com/aantron/dream/issues"
44
+
dev-repo: "git+https://github.com/aantron/dream.git"
46
+
author: "Anton Bachin <antonbachin@yahoo.com>"
47
+
maintainer: "Anton Bachin <antonbachin@yahoo.com>"
53
+
"caqti" {>= "2.0.0"}
54
+
"caqti-lwt" {>= "2.0.0"}
55
+
("conf-libev" {os != "win32"} | "ocaml" {os = "win32"})
56
+
"cstruct" {>= "6.0.0"}
57
+
"dream-httpaf" {>= "1.0.0~alpha3"}
58
+
"dream-pure" {>= "1.0.0~alpha2"}
59
+
"dune" {>= "2.7.0"} # --instrument-with.
60
+
"fmt" {>= "0.8.7"} # `Italic.
63
+
"lambdasoup" {>= "0.6.1"}
65
+
"lwt_ppx" {>= "1.2.2"}
69
+
"markup" {>= "1.0.2"}
70
+
"mirage-clock" {>= "3.0.0"} # now_d_ps : unit -> int * int64.
71
+
"mirage-crypto" {>= "0.8.1"} # AES-256-GCM.
73
+
"mirage-crypto-rng-lwt"
74
+
"multipart_form" {>= "0.4.0"}
75
+
"multipart_form-lwt"
76
+
"ocaml" {>= "4.08.0"}
77
+
"ptime" {>= "0.8.1"} # Ptime.v.
78
+
"ssl" {>= "0.5.8"} # Ssl.get_negotiated_alpn_protocol.
82
+
# Testing, development.
83
+
"alcotest" {with-test}
84
+
"bisect_ppx" {with-test & >= "2.5.0"} # --instrument-with.
85
+
"caqti-driver-postgresql" {with-test}
86
+
"caqti-driver-sqlite3" {with-test}
87
+
"crunch" {with-test}
88
+
"js_of_ocaml" {with-test}
89
+
"js_of_ocaml-ppx" {with-test}
90
+
"ppx_expect" {with-test & >= "v0.15.0"} # Formatting changes.
91
+
"ppx_yojson_conv" {with-test}
92
+
"reason" {with-test}
93
+
"tyxml" {with-test & >= "4.5.0"}
95
+
# Blocked until https://github.com/ocsigen/tyxml/pull/312.
96
+
# "tyxml-jsx" {with-test & >= "4.5.0"}
97
+
# "tyxml-ppx" {with-test & >= "4.5.0"}
101
+
["dune" "build" "-p" name "-j" jobs]
105
+
src: "https://github.com/aantron/dream/releases/download/1.0.0-alpha6/dream-1.0.0-alpha6.tar.gz"
106
+
checksum: "md5=4525b433fc9b84b153abe226628d4ef9"