2021-04-06 22:57:06 +03:00
..
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 18:48:47 +03:00
2021-04-06 20:22:41 +03:00
2021-04-06 21:16:37 +03:00
2021-04-06 22:57:06 +03:00
2021-03-25 01:59:19 +03:00
2021-03-29 21:28:33 +03:00
2021-03-24 20:34:40 +03:00
2021-03-31 16:57:33 +03:00
2021-03-29 00:00:50 +03:00
2021-03-29 21:28:33 +03:00
2021-03-29 20:20:25 +03:00
2021-03-29 21:28:33 +03:00
2021-03-24 20:34:40 +03:00
2021-03-29 21:28:33 +03:00
2021-04-06 22:57:06 +03:00

Tutorial

Dream's first several examples make up a tutorial. Each example is a complete project with a helpful README, and plenty of links to next steps and documentation. You can begin at 1-hello, or look in the list below and jump to whatever interests you!

  • 1-hello  —  the simplest Dream server responds to every request with the same friendly message.
  • 2-middleware  —  adds the first Dream middleware: the logger.
  • 3-router  —  different handlers for different paths.
  • 4-counter  —  the first custom middleware!
  • 5-promise  —  introduces Lwt, the promise library used by Dream.
  • 6-echo  —  reads request bodies.
  • 7-template  —  renders responses from inline HTML templates and guards against XSS.
  • 8-debug  —  includes detailed information about errors in responses.
  • 9-error  —  customize all error responses in one place.
  • a-log  —  writing messages to Dream's log.
  • b-session  —  associates state with client sessions.
  • c-cookie  —  sets custom cookies.
  • d-form  —  reading forms and CSRF prevention.
  • e-json  —  sending and receiving JSON securely.
  • f-static
  • g-upload
  • h-sql  —  finally CRUD!
  • i-graphql
  • j-stream
  • k-websocket
  • k-https

That's it for the tutorial!


Reason

There are several examples showing Dream with Reason syntax.


Examples

The rest of the examples cover additional topics in a more-standalone fashion. The goal of the examples is to (eventually) cover the great majority of real-world HTTP usage, so that they make up a good survey. Please open an issue if something is missing!




Roadmap

These examples will be trickled in during the alpha releases.

Ideas:

  • w-auto-reload
  • w-fullstack
  • w-index-html
  • w-one-binary
  • w-ppx-deriving
  • w-react-spa
  • w-subcommand
  • w-template-directory
  • w-tyxml  —  for TyXML templates.

Basics:

Security:

Techniques: