Skip to content

Commit

Permalink
Remove references to playground and dream.as
Browse files Browse the repository at this point in the history
Maintaining dream.as has become a time sink and it is often down. This
is likely due to an upstream issue in the HTTP stack, which might be
replaced soon anyway. For now, it is best not to try to run the
playground.

Closes #123.
Closes #222.
  • Loading branch information
aantron committed May 28, 2024
1 parent 3033ad6 commit e71c7ae
Show file tree
Hide file tree
Showing 46 changed files with 91 additions and 175 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/docker-esy.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: docker-esy
on:
push:
paths:
- 'example/z-docker-esy/**'
- .github/workflows/docker-esy.yml
# on:
# push:
# paths:
# - 'example/z-docker-esy/**'
# - .github/workflows/docker-esy.yml

jobs:
deploy:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/docker-opam.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: docker-opam
on:
push:
paths:
- 'example/z-docker-opam/**'
- .github/workflows/docker-opam.yml
# on:
# push:
# paths:
# - 'example/z-docker-opam/**'
# - .github/workflows/docker-opam.yml

jobs:
deploy:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/systemd.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: systemd
on:
push:
paths:
- 'example/z-systemd/**'
- .github/workflows/systemd.yml
# on:
# push:
# paths:
# - 'example/z-systemd/**'
# - .github/workflows/systemd.yml

jobs:
deploy:
Expand Down
13 changes: 3 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Easy-to-use, feature-complete Web framework without boilerplate.

<p align="center">
<a href="#quick-start">Quick Start</a> |
<a href="http://dream.as">Playground</a> |
<a href="https://github.com/aantron/dream/tree/master/example#readme">
Tutorial</a> |
<a href="https://aantron.github.io/dream/">Reference</a>
Expand Down Expand Up @@ -110,16 +109,12 @@ into.

## Quick start

Visit one of the first tutorials in the [online
playground][2-middleware-playground], and read its
[docs](https://github.com/aantron/dream/tree/master/example/2-middleware#files).
You can get and build it locally with:
You can get
[one](https://github.com/aantron/dream/tree/master/example/2-middleware#files)
of the first [tutorials][tutorial] and build it locally with:

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

Most of the other [examples][tutorial] are also loaded in the playground. See
the links on its [home page][playground].

### opam

Create a project directory with an optional local switch:
Expand Down Expand Up @@ -148,8 +143,6 @@ dune exec ./middleware.exe
[quickstart.sh]: https://github.com/aantron/dream/blob/master/example/quickstart.sh
[esy]: https://esy.sh/
[2-middleware]: https://github.com/aantron/dream/tree/master/example/2-middleware#files
[playground]: http://dream.as
[2-middleware-playground]: http://dream.as/2-middleware

## esy

Expand Down
5 changes: 0 additions & 5 deletions docs/web/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,6 @@ <h6>Tidy Web framework for OCaml and ReasonML</h6>
Many <a target="_blank" rel="noreferrer noopener" href="https://github.com/aantron/dream/tree/master/example#reason">
Examples</a>, covering all kinds of scenarios.
</li>
<li>
An online <a target="_blank" rel="noreferrer noopener" href="http://dream.as/">
<b>Playground</b></a>, where you can try Dream without installing
anything!
</li>
</ul>
</div>
</header>
Expand Down
3 changes: 1 addition & 2 deletions example/1-hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ browser. Your terminal probably makes the link clickable.
</code></pre>

If you go to [http://localhost:8080](http://localhost:8080), you will, of
course, see `Good morning, world!`. You can also try it in the [Dream
Playground](http://dream.as/1-hello).
course, see `Good morning, world!`.

<br>

Expand Down
3 changes: 1 addition & 2 deletions example/2-middleware/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ let () =
<br>

When you run this server and visit
[http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/2-middleware)], you get much more interesting
[http://localhost:8080](http://localhost:8080), you get much more interesting
(and colorful!) output:

![Dream log example](https://raw.githubusercontent.com/aantron/dream/master/docs/asset/log-sanitized.png)
Expand Down
4 changes: 1 addition & 3 deletions example/3-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ let () =
<br>

This is also our first dynamic site! A request to `/echo/foo` gets the response
`foo`, and a request to `/echo/bar` gets `bar`! Try it in the
[playground](http://dream.as/3-router/echo/foo) &mdash; once the server loads,
edit the URL in the right pane to visit `/echo/bar`.
`foo`, and a request to `/echo/bar` gets `bar`!

The syntax `:word` in a route creates a path parameter, which can be read with
[`Dream.param`](https://aantron.github.io/dream/#val-param).
Expand Down
3 changes: 1 addition & 2 deletions example/4-counter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

This example shows how easy it is to define a custom middleware,
`count_requests`. It exposes the request count at
[http://localhost:8080/](http://localhost:8080/)
[[playground](http://dream.as/4-counter)], in a sort of dashboard:
[http://localhost:8080/](http://localhost:8080/), in a sort of dashboard:

```ocaml
let count = ref 0
Expand Down
2 changes: 0 additions & 2 deletions example/5-promise/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ let () =
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --root . ./promise.exe</b></code></pre>

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

<br>

As you can see, the
Expand Down
2 changes: 0 additions & 2 deletions example/6-echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ let () =
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --root . ./echo.exe</b></code></pre>

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

<br>

You can test it with curl:
Expand Down
6 changes: 1 addition & 5 deletions example/7-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,11 @@ already escaped, or if it is safe for some other reason. But be careful!
To show the danger, let's launch a **script injection (XSS) attack** against
this tiny Web app! First, go to
[`template.eml.ml`](https://github.com/aantron/dream/blob/master/example/7-template/template.eml.ml#L4),
change the substitution to `<%s! param %>`, and restart the app. You can also
make the edit in the [playground](http://dream.as/7-template/foo). Then,
visit
change the substitution to `<%s! param %>`, and restart the app. Then, visit
this highly questionable URL:

[http://localhost:8080/%3Cscript%3Ealert(%22Impossible!%22)%3C%2Fscript%3E](http://localhost:8080/%3Cscript%3Ealert(%22Impossible!%22)%3C%2Fscript%3E)

If you are using the playground, change the host and port accordingly.

This URL will cause our Web app to display an alert box, which we, as the
developers, did not intend!

Expand Down
9 changes: 4 additions & 5 deletions example/8-debug/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ let () =

The rest of the app just adds two routes for triggering two kinds of
failures that the debugger will detail. Visit
[http://localhost:8080/bad](http://localhost:8080/bad)
[[playground](http://dream.as/8-debug/bad)] to trigger a `400 Bad Request`
response, and [http://localhost:8080/fail](http://localhost:8080/fail)
[[playground](http://dream.as/8-debug/fail)] to trigger an exception. The
debugger will show reports like this:
[http://localhost:8080/bad](http://localhost:8080/bad) to trigger a
`400 Bad Request` response, and
[http://localhost:8080/fail](http://localhost:8080/fail) to trigger an
exception. The debugger will show reports like this:

```
Failure("The Web app failed!")
Expand Down
2 changes: 0 additions & 2 deletions example/9-error/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ let () =
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --root . ./error.exe</b></code></pre>

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

<br>

We kept the error template simple for the sake of the example, but this is
Expand Down
3 changes: 1 addition & 2 deletions example/a-log/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ let () =

<br>

If you visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/a-log)] and then
If you visit [http://localhost:8080](http://localhost:8080) and then
[http://localhost:8080/fail](http://localhost:8080/fail), you will find these
messages in the log, between the others:

Expand Down
4 changes: 2 additions & 2 deletions example/b-session/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ let () =

<br>

The first time you access the app [[playground](http://dream.as/b-session)], it
“logs you in” by saving you user name in a session. The session manager,
The first time you access the app, it “logs you in” by saving you user name in
a session. The session manager,
[`Dream.memory_sessions`](https://aantron.github.io/dream/#val-memory_sessions),
a middleware, adds a `dream.session` cookie to the response, containing the
session key. The next time you access the app, the session is looked up again
Expand Down
7 changes: 3 additions & 4 deletions example/c-cookie/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ let () =

<br>

The first time you access this app [[playground](http://dream.as/c-cookie)], it
sets up a language preference, `ut-OP`. This string is sent to the client in a
`ui.language` cookie. On the next request, the client sends it back. The app
retrieves and displays it.
The first time you access this app, it sets up a language preference, `ut-OP`.
This string is sent to the client in a `ui.language` cookie. On the next
request, the client sends it back. The app retrieves and displays it.

<br>

Expand Down
2 changes: 0 additions & 2 deletions example/d-form/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ let () =
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --root . ./form.exe</b></code></pre>

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

<br>

The template adds a CSRF token to the form using
Expand Down
2 changes: 0 additions & 2 deletions example/e-json/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ The build commands, as always, are:
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --root . ./json.exe</b></code></pre>

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

<br>

This example expects JSON of the form `{"message": "some-message"}`. Let's test
Expand Down
3 changes: 1 addition & 2 deletions example/g-upload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,7 @@ let () =

<br>

The page shown after uploading looks like this
[[playground](http://dream.as/g-upload)]:
The page shown after uploading looks like this:

```
foo.png, 663959 bytes
Expand Down
4 changes: 2 additions & 2 deletions example/h-sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ let () =

<br>

Try visiting [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/h-sql)] and leaving some comments!
Try visiting [http://localhost:8080](http://localhost:8080) and leaving some
comments!

![Comments](https://raw.githubusercontent.com/aantron/dream/master/docs/asset/sql.png)

Expand Down
4 changes: 2 additions & 2 deletions example/i-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ let () =

<br>

Visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/i-graphql)], and you can interact with the schema:
Visit [http://localhost:8080](http://localhost:8080), and you can interact with
the schema:

![GraphiQL](https://raw.githubusercontent.com/aantron/dream/master/docs/asset/graphiql.png)

Expand Down
2 changes: 0 additions & 2 deletions example/j-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ let () =
<b>$ opam install --deps-only --yes .</b>
<b>$ dune exec --root . ./stream.exe</b></code></pre>

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

<br>

You can test it by running
Expand Down
4 changes: 2 additions & 2 deletions example/k-websocket/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ let () =

<br>

Visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/k-websocket)] to get the whole exchange started!
Visit [http://localhost:8080](http://localhost:8080) to get the whole exchange
started!

![WebSocket alert](https://raw.githubusercontent.com/aantron/dream/master/docs/asset/websocket.png)

Expand Down
4 changes: 2 additions & 2 deletions example/r-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ let () =

<br>

Visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/r-graphql)], and you can interact with the schema:
Visit [http://localhost:8080](http://localhost:8080), and you can interact with
the schema:

![GraphiQL](https://raw.githubusercontent.com/aantron/dream/master/docs/asset/graphiql.png)

Expand Down
5 changes: 2 additions & 3 deletions example/r-hello/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ let () =

<br>

After starting it, visit [http://localhost:8080](http://localhost:8080), or use
the [playground](http://dream.as/r-hello), and it will respond with its friendly
greeting!
After starting it, visit [http://localhost:8080](http://localhost:8080), and it
will respond with its friendly greeting!

<br>

Expand Down
2 changes: 0 additions & 2 deletions example/r-template-logic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ let () =
<b>$ npm install esy && npx esy</b>
<b>$ npx esy start</b></code></pre>

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

<br>

**See also:**
Expand Down
3 changes: 1 addition & 2 deletions example/r-template-stream/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ let () =

<br>

Visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/r-template-stream)] to see it in action.
Visit [http://localhost:8080](http://localhost:8080) to see it in action.

The important differences with regular usage of templates are:

Expand Down
2 changes: 0 additions & 2 deletions example/r-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ let () =
<b>$ npm install esy && npx esy</b>
<b>$ npx esy start</b></code></pre>

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

<br>

To use the templater, we need to add a stanza to our
Expand Down
5 changes: 2 additions & 3 deletions example/r-tyxml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

<br>

[TyXML](https://github.com/ocsigen/tyxml) can be used
[[playground](http://dream.as/r-tyxml)] together with Reason's built-in JSX
syntax for generating HTML on the server:
[TyXML](https://github.com/ocsigen/tyxml) can be used together with Reason's
built-in JSX syntax for generating HTML on the server:

```reason
open Tyxml
Expand Down
5 changes: 1 addition & 4 deletions example/w-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ The rest of the code hooks up the client's message form to the WebSocket.
<br>

Open [http://localhost:8080](http://localhost:8080) in two tabs to get the
whole exchange started! You can also try it in the
[playground](http://dream.as/w-chat). To connect a second tab, copy out the
address from the playground's location bar, and paste it into a new tab in your
browser.
whole exchange started!

<br>

Expand Down
7 changes: 3 additions & 4 deletions example/w-content-security-policy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ let () =

<br>

Visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/w-content-security-policy)], and your browser
should refuse to show `/nested` inside the frame on the home page. In addition,
the server log will show something like
Visit [http://localhost:8080](http://localhost:8080), and your browser should
refuse to show `/nested` inside the frame on the home page. In addition, the
server log will show something like

```
09.06.21 09:54:35.971 ERROR REQ 3 {
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 @@ -94,7 +94,7 @@ request, like this:
<br>

After starting the server, visit [http://localhost:8080](http://localhost:8080)
[[playground](http://dream.as/w-flash)] to start this little interaction!
to start this little interaction!

<br>

Expand Down
Loading

0 comments on commit e71c7ae

Please sign in to comment.