mirror of
https://github.com/aantron/dream.git
synced 2025-10-02 00:03:57 -04:00
Convert most examples to opam
Reason examples still use esy.
This commit is contained in:
parent
59abca6af0
commit
20f62d209e
@ -39,8 +39,8 @@ b {
|
||||
<body>
|
||||
|
||||
<pre><code><b>$ cd example/2-middleware</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b>
|
||||
<b>$ opam install --deps-only --yes .</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 ...
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 80 KiB |
@ -17,8 +17,8 @@ At startup, Dream prints a message to the log, telling you where to point your
|
||||
browser. Your terminal probably makes the link clickable.
|
||||
|
||||
<pre><code><b>$ cd example/1-hello</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b>
|
||||
<b>$ opam install --deps-only --yes .</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>
|
||||
@ -31,7 +31,7 @@ Playground](http://dream.as/1-hello).
|
||||
|
||||
If you'd like to copy out the server binary, you can do it like this:
|
||||
|
||||
<pre><code><b>$ npx esy cp '#{self.target_dir}/default/hello.exe' .
|
||||
<pre><code><b>$ cp _build/default/hello.exe .
|
||||
</b></code></pre>
|
||||
|
||||
The name will change as you go through the tutorial examples. It's always the
|
||||
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name hello)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./hello.exe"
|
||||
}
|
||||
}
|
7
example/1-hello/hello.opam
Normal file
7
example/1-hello/hello.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name middleware)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./middleware.exe"
|
||||
}
|
||||
}
|
@ -26,8 +26,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/3-router</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./router.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name router)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./router.exe"
|
||||
}
|
||||
}
|
7
example/3-router/router.opam
Normal file
7
example/3-router/router.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -24,8 +24,8 @@ let () =
|
||||
]
|
||||
```
|
||||
<pre><code><b>$ cd example/4-counter</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./counter.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
7
example/4-counter/counter.opam
Normal file
7
example/4-counter/counter.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name counter)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./counter.exe"
|
||||
}
|
||||
}
|
@ -41,8 +41,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/5-promise</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<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).
|
||||
|
||||
|
@ -2,5 +2,3 @@
|
||||
(name promise)
|
||||
(libraries dream)
|
||||
(preprocess (pps lwt_ppx)))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./promise.exe"
|
||||
}
|
||||
}
|
7
example/5-promise/promise.opam
Normal file
7
example/5-promise/promise.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -21,8 +21,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/6-echo</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<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).
|
||||
|
||||
|
@ -2,5 +2,3 @@
|
||||
(name echo)
|
||||
(libraries dream)
|
||||
(preprocess (pps lwt_ppx)))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
7
example/6-echo/echo.opam
Normal file
7
example/6-echo/echo.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./echo.exe"
|
||||
}
|
||||
}
|
@ -31,8 +31,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/7-template</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./template.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -6,5 +6,3 @@
|
||||
(targets template.ml)
|
||||
(deps template.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./template.exe"
|
||||
}
|
||||
}
|
7
example/7-template/template.opam
Normal file
7
example/7-template/template.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -23,8 +23,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/8-debug</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./debug.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
7
example/8-debug/debug.opam
Normal file
7
example/8-debug/debug.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name debug)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./debug.exe"
|
||||
}
|
||||
}
|
@ -33,8 +33,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/9-error</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<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).
|
||||
|
||||
|
@ -6,5 +6,3 @@
|
||||
(targets error.ml)
|
||||
(deps error.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
7
example/9-error/error.opam
Normal file
7
example/9-error/error.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./error.exe"
|
||||
}
|
||||
}
|
@ -25,8 +25,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/a-log</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./log.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name log)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./log.exe"
|
||||
}
|
||||
}
|
7
example/a-log/log.opam
Normal file
7
example/a-log/log.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -23,8 +23,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/b-session</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./session.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -2,5 +2,3 @@
|
||||
(name session)
|
||||
(libraries dream)
|
||||
(preprocess (pps lwt_ppx)))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./session.exe"
|
||||
}
|
||||
}
|
7
example/b-session/session.opam
Normal file
7
example/b-session/session.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -24,8 +24,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/c-cookie</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./cookie.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
7
example/c-cookie/cookie.opam
Normal file
7
example/c-cookie/cookie.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name cookie)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./cookie.exe"
|
||||
}
|
||||
}
|
@ -46,8 +46,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/d-form</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<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).
|
||||
|
||||
|
@ -7,5 +7,3 @@
|
||||
(targets form.ml)
|
||||
(deps form.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./form.exe"
|
||||
}
|
||||
}
|
7
example/d-form/form.opam
Normal file
7
example/d-form/form.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -49,22 +49,21 @@ To get this working, we have to add `ppx_yojson_conv` to our
|
||||
</code></pre>
|
||||
|
||||
and to
|
||||
[`esy.json`](https://github.com/aantron/dream/blob/master/example/e-json/esy.json):
|
||||
[`json.opam`](https://github.com/aantron/dream/blob/master/example/e-json/json.opam):
|
||||
|
||||
<pre><code>{
|
||||
"dependencies": {
|
||||
"@opam/dream": "aantron/dream:dream.opam",
|
||||
"@opam/dune": "^2.0",
|
||||
<b>"@opam/ppx_yojson_conv": "*",</b>
|
||||
"ocaml": "4.12.x"
|
||||
}
|
||||
<pre><code>depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
<b>"ppx_yojson_conv"</b>
|
||||
]
|
||||
</code></pre>
|
||||
|
||||
The build commands, as always, are:
|
||||
|
||||
<pre><code><b>$ cd example/e-json</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<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).
|
||||
|
||||
|
@ -2,5 +2,3 @@
|
||||
(name json)
|
||||
(libraries dream)
|
||||
(preprocess (pps lwt_ppx ppx_yojson_conv)))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"@opam/ppx_yojson_conv": "*",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./json.exe"
|
||||
}
|
||||
}
|
8
example/e-json/json.opam
Normal file
8
example/e-json/json.opam
Normal file
@ -0,0 +1,8 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
"ppx_yojson_conv"
|
||||
]
|
@ -5,8 +5,8 @@
|
||||
Run this example:
|
||||
|
||||
<pre><code><b>$ cd example/f-static</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./static.exe</b></code></pre>
|
||||
|
||||
...and visit
|
||||
[http://localhost:8080/static/static.ml](http://localhost:8080/static/static.ml).
|
||||
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name static)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./static.exe"
|
||||
}
|
||||
}
|
7
example/f-static/static.opam
Normal file
7
example/f-static/static.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -51,8 +51,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/g-upload</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./upload.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -7,5 +7,3 @@
|
||||
(targets upload.ml)
|
||||
(deps upload.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./upload.exe"
|
||||
}
|
||||
}
|
7
example/g-upload/upload.opam
Normal file
7
example/g-upload/upload.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -67,8 +67,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/h-sql</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./sql.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
@ -118,11 +118,14 @@ We also had to make an addition to our
|
||||
</pre>
|
||||
|
||||
...and to
|
||||
[`esy.json`](https://github.com/aantron/dream/blob/master/example/h-sql/esy.json):
|
||||
[`sql.opam`](https://github.com/aantron/dream/blob/master/example/h-sql/esy.json):
|
||||
|
||||
<pre>"dependencies": {
|
||||
<b>"@opam/caqti-driver-sqlite3": "^1.7.0"</b>
|
||||
}
|
||||
<pre>depends: [
|
||||
<b>"caqti-driver-sqlite3" {>= "1.7.0"}</b>
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
||||
</pre>
|
||||
|
||||
<br>
|
||||
|
@ -7,5 +7,3 @@
|
||||
(targets sql.ml)
|
||||
(deps sql.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,19 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/caqti-driver-sqlite3": "^1.7.0",
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./sql.exe"
|
||||
}
|
||||
}
|
8
example/h-sql/sql.opam
Normal file
8
example/h-sql/sql.opam
Normal file
@ -0,0 +1,8 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"caqti-driver-sqlite3" {>= "1.7.0"}
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -58,8 +58,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/i-graphql</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./graphql.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name graphql)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./graphql.exe"
|
||||
}
|
||||
}
|
7
example/i-graphql/graphql.opam
Normal file
7
example/i-graphql/graphql.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -33,8 +33,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/j-stream</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<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).
|
||||
|
||||
|
@ -2,5 +2,3 @@
|
||||
(name stream)
|
||||
(libraries dream)
|
||||
(preprocess (pps lwt_ppx)))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./stream.exe"
|
||||
}
|
||||
}
|
7
example/j-stream/stream.opam
Normal file
7
example/j-stream/stream.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -49,8 +49,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/k-websocket</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./websocket.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -7,5 +7,3 @@
|
||||
(targets websocket.ml)
|
||||
(deps websocket.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./websocket.exe"
|
||||
}
|
||||
}
|
7
example/k-websocket/websocket.opam
Normal file
7
example/k-websocket/websocket.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -13,8 +13,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/l-https</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./https.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
(executable
|
||||
(name https)
|
||||
(libraries dream))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./https.exe"
|
||||
}
|
||||
}
|
7
example/l-https/https.opam
Normal file
7
example/l-https/https.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -28,8 +28,8 @@ let handle_client client =
|
||||
The rest of the code hooks up the client's message form to the WebSocket.
|
||||
|
||||
<pre><code><b>$ cd example/w-chat</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./chat.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
7
example/w-chat/chat.opam
Normal file
7
example/w-chat/chat.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -7,5 +7,3 @@
|
||||
(targets chat.ml)
|
||||
(deps chat.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./chat.exe"
|
||||
}
|
||||
}
|
@ -44,8 +44,8 @@ let () =
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/w-content-security-policy</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./content_security_policy.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -7,5 +7,3 @@
|
||||
(targets content_security_policy.ml)
|
||||
(deps content_security_policy.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./content_security_policy.exe"
|
||||
}
|
||||
}
|
@ -88,8 +88,8 @@ request, like this:
|
||||
```
|
||||
|
||||
<pre><code><b>$ cd example/w-flash</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune exec --root . ./flash.exe</b></code></pre>
|
||||
|
||||
<br>
|
||||
|
||||
|
@ -7,5 +7,3 @@
|
||||
(targets flash.ml)
|
||||
(deps flash.eml.ml)
|
||||
(action (run dream_eml %{deps} --workspace %{workspace_root})))
|
||||
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
||||
|
@ -1,18 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . ./flash.exe"
|
||||
}
|
||||
}
|
7
example/w-flash/flash.opam
Normal file
7
example/w-flash/flash.opam
Normal file
@ -0,0 +1,7 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
]
|
@ -54,18 +54,13 @@ let () =
|
||||
|
||||
To run the example, do
|
||||
|
||||
<pre><code><b>cd example/w-fullstack-jsoo</b>
|
||||
<b>dune build --root . client/client.bc.js
|
||||
mkdir -p static
|
||||
cp _build/default/client/client.bc.js static/client.js
|
||||
dune exec --root . server/server.exe
|
||||
</b></code></pre>
|
||||
|
||||
You can also trigger it all with esy with
|
||||
|
||||
<pre><code><b>$ cd example/w-fullstack-jsoo</b>
|
||||
<b>$ npm install esy && npx esy</b>
|
||||
<b>$ npx esy start</b></code></pre>
|
||||
<b>$ opam install --deps-only --yes .</b>
|
||||
<b>$ dune build --root . client/client.bc.js
|
||||
$ mkdir -p static
|
||||
$ cp _build/default/client/client.bc.js static/client.js
|
||||
$ dune exec --root . server/server.exe
|
||||
</b></code></pre>
|
||||
|
||||
Then visit [http://localhost:8080](http://localhost:8080), and you will see...
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
(data_only_dirs _esy esy.lock lib node_modules)
|
@ -1,29 +0,0 @@
|
||||
{
|
||||
"dependencies": {
|
||||
"@opam/conf-libssl": "3",
|
||||
"@opam/dream": "1.0.0~alpha5",
|
||||
"@opam/dune": "^3.0",
|
||||
"@opam/js_of_ocaml": "*",
|
||||
"@opam/js_of_ocaml-ppx": "*",
|
||||
"ocaml": "^4.14.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@opam/ocaml-lsp-server": "*"
|
||||
},
|
||||
"resolutions": {
|
||||
"@opam/conf-libev": "esy-packages/libev:package.json#0b5eb6685b688649045aceac55dc559f6f21b829",
|
||||
"esy-openssl": "esy-packages/esy-openssl#619ae2d46ca981ec26ab3287487ad98b157a01d1"
|
||||
},
|
||||
"esy": {
|
||||
"buildsInSource": "unsafe",
|
||||
"build": [
|
||||
"dune build --root . client/client.bc.js",
|
||||
"mkdir -p static",
|
||||
"cp _build/default/client/client.bc.js static/client.js",
|
||||
"dune build --root . server/server.exe"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"start": "dune exec --root . server/server.exe"
|
||||
}
|
||||
}
|
9
example/w-fullstack-jsoo/fullstack-jsoo.opam
Normal file
9
example/w-fullstack-jsoo/fullstack-jsoo.opam
Normal file
@ -0,0 +1,9 @@
|
||||
opam-version: "2.0"
|
||||
|
||||
depends: [
|
||||
"ocaml" {>= "4.08.0"}
|
||||
"dream"
|
||||
"dune" {>= "2.0.0"}
|
||||
"js_of_ocaml"
|
||||
"js_of_ocaml-ppx"
|
||||
]
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user