Skip to content

Commit

Permalink
Examples: add --root . to build steps
Browse files Browse the repository at this point in the history
Resolves #308.
  • Loading branch information
aantron committed Dec 26, 2023
1 parent 5f42c87 commit bbbf188
Show file tree
Hide file tree
Showing 40 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion docs/asset/log-sanitized.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

<pre><code><b>$ cd example/2-middleware</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./middleware.exe</b>
<b>$ dune exec --root . ./middleware.exe</b>
<span class="dim">08.03.21 22:19:21.126</span> Running at http://localhost:8080
<span class="dim">08.03.21 22:19:21.126</span> Type Ctrl+C to stop
<span class="dim">08.03.21 22:19:24.927</span> dream.log <span class="info">INFO</span> <span class="odd">REQ 1</span> GET / 127.0.0.1:58549 Mozilla/5.0 ...
Expand Down
Binary file modified docs/asset/log-sanitized.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion example/1-hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ browser. Your terminal probably makes the link clickable.

<pre><code><b>$ cd example/1-hello</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./hello.exe</b>
<b>$ dune exec --root . ./hello.exe</b>
08.03.21 21:17:21.471 Running at http://localhost:8080
08.03.21 21:17:21.471 Type Ctrl+C to stop
</code></pre>
Expand Down
2 changes: 1 addition & 1 deletion example/3-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let () =

<pre><code><b>$ cd example/3-router</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./router.exe</b></code></pre>
<b>$ dune exec --root . ./router.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/4-counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let () =
```
<pre><code><b>$ cd example/4-counter</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./counter.exe</b></code></pre>
<b>$ dune exec --root . ./counter.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/5-promise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let () =

<pre><code><b>$ cd example/5-promise</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./promise.exe</b></code></pre>
<b>$ dune exec --root . ./promise.exe</b></code></pre>

Try it in the [playground](http://dream.as/5-promise).

Expand Down
2 changes: 1 addition & 1 deletion example/6-echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let () =

<pre><code><b>$ cd example/6-echo</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./echo.exe</b></code></pre>
<b>$ dune exec --root . ./echo.exe</b></code></pre>

...or run it in the [playground](http://dream.as/6-echo).

Expand Down
2 changes: 1 addition & 1 deletion example/7-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ let () =

<pre><code><b>$ cd example/7-template</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./template.exe</b></code></pre>
<b>$ dune exec --root . ./template.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/8-debug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let () =

<pre><code><b>$ cd example/8-debug</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./debug.exe</b></code></pre>
<b>$ dune exec --root . ./debug.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/9-error/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let () =

<pre><code><b>$ cd example/9-error</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./error.exe</b></code></pre>
<b>$ dune exec --root . ./error.exe</b></code></pre>

Try it in the [playground](http://dream.as/9-error).

Expand Down
2 changes: 1 addition & 1 deletion example/a-log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ let () =

<pre><code><b>$ cd example/a-log</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./log.exe</b></code></pre>
<b>$ dune exec --root . ./log.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/b-session/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let () =

<pre><code><b>$ cd example/b-session</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./session.exe</b></code></pre>
<b>$ dune exec --root . ./session.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/c-cookie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let () =

<pre><code><b>$ cd example/c-cookie</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./cookie.exe</b></code></pre>
<b>$ dune exec --root . ./cookie.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/d-form/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ let () =

<pre><code><b>$ cd example/d-form</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./form.exe</b></code></pre>
<b>$ dune exec --root . ./form.exe</b></code></pre>

Try it in the [playground](http://dream.as/d-form).

Expand Down
2 changes: 1 addition & 1 deletion example/e-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ The build commands, as always, are:

<pre><code><b>$ cd example/e-json</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./json.exe</b></code></pre>
<b>$ dune exec --root . ./json.exe</b></code></pre>

You can try this example in the [playground](http://dream.as/e-json).

Expand Down
2 changes: 1 addition & 1 deletion example/f-static/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Run this example:

<pre><code><b>$ cd example/f-static</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./static.exe</b></code></pre>
<b>$ dune exec --root . ./static.exe</b></code></pre>

...and visit
[http://localhost:8080/static/static.ml](http://localhost:8080/static/static.ml).
Expand Down
2 changes: 1 addition & 1 deletion example/g-upload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let () =

<pre><code><b>$ cd example/g-upload</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./upload.exe</b></code></pre>
<b>$ dune exec --root . ./upload.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/h-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ let () =

<pre><code><b>$ cd example/h-sql</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./sql.exe</b></code></pre>
<b>$ dune exec --root . ./sql.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/i-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ let () =

<pre><code><b>$ cd example/i-graphql</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./graphql.exe</b></code></pre>
<b>$ dune exec --root . ./graphql.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/j-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let () =

<pre><code><b>$ cd example/j-stream</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./stream.exe</b></code></pre>
<b>$ dune exec --root . ./stream.exe</b></code></pre>

Try running it in the [playground](http://dream.as/j-stream).

Expand Down
2 changes: 1 addition & 1 deletion example/k-websocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ let () =

<pre><code><b>$ cd example/k-websocket</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./websocket.exe</b></code></pre>
<b>$ dune exec --root . ./websocket.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/l-https/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ let () =

<pre><code><b>$ cd example/l-https</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./https.exe</b></code></pre>
<b>$ dune exec --root . ./https.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/r-fullstack-melange/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ $ npm install esbuild --no-save
$ dune build --root . @melange
$ mkdir -p static
$ npx esbuild _build/default/client/client/client/client.js --bundle --outfile=static/client.js
$ dune exec server/server.exe
$ dune exec --root . server/server.exe
</b></code></pre>

Then visit [http://localhost:8080](http://localhost:8080), and you will see...
Expand Down
2 changes: 1 addition & 1 deletion example/w-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The rest of the code hooks up the client's message form to the WebSocket.

<pre><code><b>$ cd example/w-chat</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./chat.exe</b></code></pre>
<b>$ dune exec --root . ./chat.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/w-content-security-policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ let () =

<pre><code><b>$ cd example/w-content-security-policy</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./content_security_policy.exe</b></code></pre>
<b>$ dune exec --root . ./content_security_policy.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/w-flash/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ request, like this:

<pre><code><b>$ cd example/w-flash</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./flash.exe</b></code></pre>
<b>$ dune exec --root . ./flash.exe</b></code></pre>

<br>

Expand Down
4 changes: 2 additions & 2 deletions example/w-fullstack-jsoo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ To run the example, do

<pre><code><b>$ cd example/w-fullstack-jsoo</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune build client/client.bc.js
<b>$ dune build --root . client/client.bc.js
$ mkdir -p static
$ cp _build/default/client/client.bc.js static/client.js
$ dune exec server/server.exe
$ dune exec --root . server/server.exe
</b></code></pre>

Then visit [http://localhost:8080](http://localhost:8080), and you will see...
Expand Down
2 changes: 1 addition & 1 deletion example/w-graphql-subscription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ let () =

<pre><code><b>$ cd example/w-graphql-subscription</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./graphql_subscription.exe</b></code></pre>
<b>$ dune exec --root . ./graphql_subscription.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/w-live-reload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ let () =

<pre><code><b>$ cd example/w-live-reload</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./live_reload.exe</b>
<b>$ dune exec --root . ./live_reload.exe</b>
</code></pre>

<br>
Expand Down
2 changes: 1 addition & 1 deletion example/w-mirage/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Mirage. To build and run, do
<b>$ opam install mirage</b>
<b>$ mirage configure -t unix</b>
<b>$ make depends</b>
<b>$ dune build</b>
<b>$ dune build --root .</b>
<b>$ _build/default/main.exe</b>
</code></pre>

Expand Down
2 changes: 1 addition & 1 deletion example/w-multipart-dump/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Content-Type: application/octet-stream

<pre><code><b>$ cd example/w-multipart-dump</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./multipart_dump.exe</b></code></pre>
<b>$ dune exec --root . ./multipart_dump.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/w-one-binary/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ To build the whole setup, just do

<pre><code><b>$ cd example/w-one-binary</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./one_binary.exe</b></code></pre>
<b>$ dune exec --root . ./one_binary.exe</b></code></pre>

You can now visit
[http://localhost:8080/assets/camel.jpeg](http://localhost:8080/assets/camel.jpeg)
Expand Down
2 changes: 1 addition & 1 deletion example/w-query/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let () =

<pre><code><b>$ cd example/w-query</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./query.exe</b></code></pre>
<b>$ dune exec --root . ./query.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/w-stress-response/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ by default. To use,

<pre><code><b>$ cd example/w-stress-response</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./stress_response.exe</b>
<b>$ dune exec --root . ./stress_response.exe</b>
<b>$ curl http://localhost:8080 > /dev/null &</b></code></pre>

The `curl` command can be repeated for multiple concurrent clients, to check
Expand Down
2 changes: 1 addition & 1 deletion example/w-template-files/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ let () =

<pre><code><b>$ cd example/w-template-files</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./server.exe</b></code></pre>
<b>$ dune exec --root . ./server.exe</b></code></pre>

<br>

Expand Down
2 changes: 1 addition & 1 deletion example/w-template-logic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ let () =

<pre><code><b>$ cd example/w-template-logic</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./template.exe</b></code></pre>
<b>$ dune exec --root . ./template.exe</b></code></pre>

Try it in the [playground](http://dream.as/w-template-logic).

Expand Down
2 changes: 1 addition & 1 deletion example/w-template-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ let () =

<pre><code><b>$ cd example/w-template-stream</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./template_stream.exe</b></code></pre>
<b>$ dune exec --root . ./template_stream.exe</b></code></pre>

Try it in the [playground](http://dream.as/w-template-stream).

Expand Down
2 changes: 1 addition & 1 deletion example/w-tyxml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ let () =

<pre><code><b>$ cd example/w-tyxml</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./tyxml.exe</b></code></pre>
<b>$ dune exec --root . ./tyxml.exe</b></code></pre>

Try it in the [playground](http://dream.as/w-tyxml).

Expand Down
2 changes: 1 addition & 1 deletion example/w-upload-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let () =

<pre><code><b>cd example/w-upload-stream</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec ./upload_stream.exe</b></code></pre>
<b>$ dune exec --root . ./upload_stream.exe</b></code></pre>

Try it in the [playground](http://dream.as/w-upload-stream).

Expand Down
2 changes: 1 addition & 1 deletion example/w-watch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ and run your server when you make changes.

<pre><code><b>$ cd example/w-watch</b>
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --watch ./hello.exe</b></code></pre>
<b>$ dune exec --root . --watch ./hello.exe</b></code></pre>

Note that this requires Dune 3.7.0 or higher.

Expand Down

0 comments on commit bbbf188

Please sign in to comment.