···
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>"
51
+
"base64" {>= "3.1.0"} # Base64.encode_string.
53
+
"caqti" {>= "1.4.0"} # ~post_connect.
55
+
"conf-libev" {os != "win32"}
56
+
"cstruct" {>= "6.0.0"}
57
+
"dune" {>= "2.7.0"} # --instrument-with.
58
+
"fmt" {>= "0.8.7"} # `Italic.
63
+
"lwt_ppx" {>= "1.2.2"}
68
+
"mirage-crypto" {>= "0.8.1"} # AES-256-GCM.
69
+
"mirage-crypto-rng" {>= "0.8.0"} # Signature of initialize.
70
+
"multipart_form" {>= "0.3.0"}
71
+
"ocaml" {>= "4.08.0"}
75
+
# Currently vendored.
85
+
# Dependencies of vendored packages.
86
+
"angstrom" {>= "0.14.0"}
87
+
"bigstringaf" {>= "0.5.0"}
88
+
"digestif" {>= "0.7"} # websocket/af, sha1.
89
+
"faraday" {>= "0.6.1"}
92
+
"result" # http/af, websocket/af.
94
+
# https://github.com/ocaml-ppx/ppxlib/issues/221.
95
+
# esy appears to ignore conflicts.
96
+
"ppxlib" {< "0.21.0" | > "0.22.0"}
98
+
# Testing, development.
99
+
"alcotest" {with-test}
100
+
# Commented out because of https://github.com/ocaml-ppx/ppxlib/issues/221.
101
+
# "bisect_ppx" {with-test & >= "2.5.0"} # --instrument-with.
102
+
"caqti-driver-sqlite3" {with-test}
103
+
"crunch" {with-test}
104
+
"lambdasoup" {with-test}
105
+
"ppx_expect" {with-test}
106
+
"ppx_yojson_conv" {with-test}
107
+
"reason" {with-test}
108
+
"tyxml" {with-test & >= "4.5.0"}
109
+
"tyxml-jsx" {with-test & >= "4.5.0"}
110
+
"tyxml-ppx" {with-test & >= "4.5.0"}
114
+
["dune" "build" "-p" name "-j" jobs]
118
+
src: "https://github.com/aantron/dream/releases/download/1.0.0-alpha2/dream-1.0.0-alpha2.tar.gz"
119
+
checksum: "md5=1220f17530522e488653eb91115867e3"