Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

r-hello


This example shows the simplest Dream program one could write:

let () =
  Dream.run(_ =>
    Dream.html("Good morning, reasonable world!"));
$ cd example/r-hello
$ npm install esy && npx esy
$ npx esy start
08.04.21 13:55:56.552                       Running at http://localhost:8080
08.04.21 13:55:56.553                       Type Ctrl+C to stop

After starting it, visit http://localhost:8080, and it will respond with its friendly greeting!


Note that we had to make an addition to esy.json:

"dependencies": {
  "@opam/reason": "^3.0.0"
}


See also:

  • r-template shows templates with Reason syntax.
  • 2-middleware introduces the logger, the most commonly used Dream middleware. The example is in OCaml syntax.

Up to the example index