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— our content is now slightly dynamic!5-echo6-template— render responses from templates and guard against XSS.7-debug— centralize your error page and run the debugger.8-error-page9-logginga-promiseb-sessionc-cookied-form— reading forms and CSRF prevention.e-jsonf-staticg-uploadh-sql— finally CRUD!i-graphqlj-streamingk-websocketl-httpsm-crypton-locals
That's it for the tutorial!
Scroll down for everything else.
There are several examples of using Dream with Reason syntax:
The rest of the examples cover additional topics in a more-standalone fashion. They are, however, still complete, self-contained projects in the same style.
The goal of the examples is to cover the great majority of real-world HTTP usage, so that perusing them gives a good survey. Please open an issue if something is missing!
Ideas:
Basics:
Security:
w-authw-client-side-sessionw-corsw-database-sessionw-file-sessionw-form-expiredw-json-csrfw-jwtw-upload-csrf
Techniques:
w-etagw-graphql-sqlw-graphql-subscriptionsw-https-redirectw-long-pollingw-postgres-dockerw-server-sent-eventsw-sql-streamingw-template-streamingw-websocket-streaming
Advanced customization: