Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Tidy, feature-complete Web framework

License

NotificationsYou must be signed in to change notification settings

camlworks/dream

Repository files navigation

Easy-to-use, feature-complete Web framework without boilerplate.


Source code of minimal app using the Dream Web framework for OCaml

Quick Start | Tutorial |Reference   



Dream isone flat module inone package, documented onone page, but withmany examples. It offers:


...all without sacrificing ease of use — Dream has:


Every part of the API is arranged to be easy to understand, use, and remember.Dream sticks to base OCaml types likestring andlist, introducing only afewtypes of its own — and some of those are just abbreviationsfor bare functions!

The neat interface is not a limitation. Everything is still configurable by alarge number of optional arguments, and very loose coupling. Where necessary,Dream exposes the lower-level machinery that it is composed from. For example,the basic body and WebSocket readersreturn strings, but you canalso dozero-copy streaming.

You can even run Dream as aquite bare abstraction over itsunderlyingset of HTTP libraries, where it acts only as minimal glue code betweentheir slightly different interfaces.

And, even though Dream is presented as one package for ordinary usage, it isinternally factored intoseveral sub-libraries, according to thedifferent dependencies of each, for fast porting to different environments.

Dream is a low-level and unopinionated framework, and you can swap out itsconveniences. For example, you can use TyXML withserver-side JSXinstead of Dream's built-in templates. You can bundle assets into asingleDream binary, or use Dream in a subcommand. Dream tries to be asfunctional as possible, touching global runtime state only lazily, when calledinto.


Quick start

You can getoneof the firsttutorials and build it locally with:

bash -c "$(curl -fsSL https://raw.githubusercontent.com/aantron/dream/master/example/quickstart.sh)"

opam

Create a project directory with an optional local switch:

mkdir projectcd projectopam switch create . 5.1.0eval $(opam env)

Install Dream:

opam install dream

After that, go to any of theexamples, such as2-middleware, re-create the files locally, and run it:

dune exec ./middleware.exe

esy

Visit any of theexamples, such as2-middleware, and re-create the files locally. The fileesy.jsonshows how to depend on Dream. All of the examples are installed by runningnpx esy, and started withnpx esy start.


Documentation


Recommended projects


Example repositories


Contact

Apart from theissues, good placesto discuss Dream are...

Highlight@antron to poke @aantron specifically.


Contributing

All kinds of contributions are welcome, including examples, links to blogs,related libraries, and, of course, PRs! SeeCONTRIBUTING.md.


Acknowledgements

Dream is based on work by the authors and contributors of itsmanydependencies and their transitive dependencies. There are, however,several influences that cannot be discovered directly:

Sponsor this project

 

Contributors54


[8]ページ先頭

©2009-2025 Movatter.jp